diff --git a/src/js/parser/javascript/base.js b/src/js/parser/javascript/base.js index b254e19..b40a103 100644 --- a/src/js/parser/javascript/base.js +++ b/src/js/parser/javascript/base.js @@ -20,6 +20,8 @@ export default { text: text }); + this._labelGroups.push(group); + return group; }, @@ -39,6 +41,7 @@ export default { }, render() { + this._labelGroups = []; this._render(); }, @@ -46,6 +49,7 @@ export default { if (this._proxy) { this._proxy.position(); } else { + _.each(this._labelGroups, this.positionLabel.bind(this)); this._position(); } }, @@ -70,7 +74,6 @@ export default { }, _position() { - this.positionLabel(this.label); }, spaceHorizontally(items, options) { diff --git a/src/js/parser/javascript/match.js b/src/js/parser/javascript/match.js index aaa8f10..034afde 100644 --- a/src/js/parser/javascript/match.js +++ b/src/js/parser/javascript/match.js @@ -33,14 +33,6 @@ export default _.extend({}, Base, { _position() { var items; - if (this.contents.anchor_start) { - this.positionLabel(this.contents.anchor_start); - } - - if (this.contents.anchor_end) { - this.positionLabel(this.contents.anchor_end); - } - _.invoke(this.contents.parts, 'position'); items = _(this.contents).values().flatten().value();