From d953dcaab4b99ba3817269cf0c5c237dfb16bcf6 Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Wed, 10 Dec 2014 19:12:17 -0500 Subject: [PATCH] renderLabel method doesn't really need a container argument --- src/js/parser/javascript/any_character.js | 2 +- src/js/parser/javascript/base.js | 6 +++--- src/js/parser/javascript/escape.js | 2 +- src/js/parser/javascript/literal.js | 2 +- src/js/parser/javascript/match.js | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/js/parser/javascript/any_character.js b/src/js/parser/javascript/any_character.js index 01948f3..fd99555 100644 --- a/src/js/parser/javascript/any_character.js +++ b/src/js/parser/javascript/any_character.js @@ -5,6 +5,6 @@ export default _.extend({}, Base, { type: 'any-character', _render() { - this.label = this.renderLabel(this.container, 'any character'); + this.label = this.renderLabel('any character'); } }); diff --git a/src/js/parser/javascript/base.js b/src/js/parser/javascript/base.js index 6ea0166..b254e19 100644 --- a/src/js/parser/javascript/base.js +++ b/src/js/parser/javascript/base.js @@ -10,8 +10,8 @@ export default { return this.container.getBBox(); }, - renderLabel(container, text) { - var group = container.group() + renderLabel(text) { + var group = this.container.group() .addClass('label'); group.rect(); @@ -61,7 +61,7 @@ export default { this.container.addClass('placeholder'); - this.label = this.renderLabel(this.container, this.textValue); + this.label = this.renderLabel(this.textValue); this.label.select('rect').attr({ rx: 10, diff --git a/src/js/parser/javascript/escape.js b/src/js/parser/javascript/escape.js index 6cf8db9..a921a76 100644 --- a/src/js/parser/javascript/escape.js +++ b/src/js/parser/javascript/escape.js @@ -13,7 +13,7 @@ export default _.extend({}, Base, { }, _render() { - this.label = this.renderLabel(this.container, _.result(this, this.code())); + this.label = this.renderLabel(_.result(this, this.code())); this.label.select('rect').attr({ rx: 3, diff --git a/src/js/parser/javascript/literal.js b/src/js/parser/javascript/literal.js index 3234bf4..92ae7e6 100644 --- a/src/js/parser/javascript/literal.js +++ b/src/js/parser/javascript/literal.js @@ -5,7 +5,7 @@ export default _.extend({}, Base, { type: 'literal', _render() { - this.label = this.renderLabel(this.container, '"' + this.literal.textValue + '"'); + this.label = this.renderLabel('"' + this.literal.textValue + '"'); this.label.select('rect').attr({ rx: 3, diff --git a/src/js/parser/javascript/match.js b/src/js/parser/javascript/match.js index 4848bdf..aaa8f10 100644 --- a/src/js/parser/javascript/match.js +++ b/src/js/parser/javascript/match.js @@ -11,7 +11,7 @@ export default _.extend({}, Base, { this.contents = {}; if (this.anchorStart()) { - this.contents.anchor_start = this.renderLabel(this.container, 'Start of line') + this.contents.anchor_start = this.renderLabel('Start of line') .addClass('anchor'); } @@ -22,7 +22,7 @@ export default _.extend({}, Base, { }).bind(this)); if (this.anchorEnd()) { - this.contents.anchor_end = this.renderLabel(this.container, 'End of line') + this.contents.anchor_end = this.renderLabel('End of line') .addClass('anchor'); } } else {