From 15655900f181a0fd0e169acea0148113daa38c4e Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Wed, 10 Dec 2014 19:16:21 -0500 Subject: [PATCH] Updating to automatically size labels when positioning --- src/js/parser/javascript/base.js | 5 ++++- src/js/parser/javascript/match.js | 8 -------- 2 files changed, 4 insertions(+), 9 deletions(-) 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();