Removing need for separate setContainer calls
This commit is contained in:
parent
9ac25b9a50
commit
dbcdd583ed
@ -40,7 +40,11 @@ export default {
|
||||
});
|
||||
},
|
||||
|
||||
render() {
|
||||
render(container) {
|
||||
if (container) {
|
||||
this.setContainer(container);
|
||||
}
|
||||
|
||||
this._labelGroups = [];
|
||||
this._render();
|
||||
},
|
||||
@ -56,8 +60,7 @@ export default {
|
||||
|
||||
proxy(node) {
|
||||
this._proxy = node;
|
||||
this._proxy.setContainer(this.container);
|
||||
this._proxy.render();
|
||||
this._proxy.render(this.container);
|
||||
},
|
||||
|
||||
_render() {
|
||||
|
@ -10,8 +10,7 @@ export default _.extend({}, Base, {
|
||||
this.partContainer = this.container.group();
|
||||
|
||||
_.each(this.parts.elements, (part => {
|
||||
part.setContainer(this.partContainer.group());
|
||||
part.render();
|
||||
part.render(this.partContainer.group());
|
||||
}).bind(this));
|
||||
},
|
||||
|
||||
|
@ -5,11 +5,8 @@ export default _.extend({}, Base, {
|
||||
type: 'charset-range',
|
||||
|
||||
_render() {
|
||||
this.first.setContainer(this.container.group());
|
||||
this.first.render();
|
||||
|
||||
this.last.setContainer(this.container.group());
|
||||
this.last.render();
|
||||
this.first.render(this.container.group());
|
||||
this.last.render(this.container.group());
|
||||
|
||||
this.hyphen = this.container.text()
|
||||
.attr({
|
||||
@ -18,8 +15,6 @@ export default _.extend({}, Base, {
|
||||
},
|
||||
|
||||
_position() {
|
||||
var box;
|
||||
|
||||
this.first.position();
|
||||
this.last.position();
|
||||
|
||||
|
@ -16,8 +16,7 @@ export default _.extend({}, Base, {
|
||||
}
|
||||
|
||||
this.contents.parts = _.map(parts, (function(part) {
|
||||
part.setContainer(this.container.group());
|
||||
part.render();
|
||||
part.render(this.container.group());
|
||||
return part;
|
||||
}).bind(this));
|
||||
|
||||
|
@ -8,8 +8,7 @@ export default _.extend({}, Base, {
|
||||
if (this._repeat.textValue === '') {
|
||||
this.proxy(this._content);
|
||||
} else {
|
||||
this._content.setContainer(this.container.group());
|
||||
this._content.render();
|
||||
this._content.render(this.container.group());
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -14,9 +14,7 @@ export default _.extend({}, Base, {
|
||||
.addClass('regexp-matches');
|
||||
|
||||
_.each(matches, (match => {
|
||||
match.setContainer(this.matchContainer.group());
|
||||
match.render();
|
||||
return match.container;
|
||||
match.render(this.matchContainer.group());
|
||||
}).bind(this));
|
||||
}
|
||||
},
|
||||
|
@ -5,9 +5,9 @@ export default _.extend({}, Base, {
|
||||
type: 'root',
|
||||
|
||||
_render() {
|
||||
this.regexp.setContainer(this.container.group().transform(Snap.matrix()
|
||||
.translate(10, 0)));
|
||||
this.regexp.render();
|
||||
this.regexp.render(this.container.group());
|
||||
this.regexp.container.transform(Snap.matrix()
|
||||
.translate(10, 0));
|
||||
|
||||
this.start = this.container.circle()
|
||||
.addClass('pin')
|
||||
|
@ -18,8 +18,7 @@ export default _.extend({}, Base, {
|
||||
if (label) {
|
||||
this.renderLabeledBox(label);
|
||||
|
||||
this.regexp.setContainer(this.container.group());
|
||||
this.regexp.render();
|
||||
this.regexp.render(this.container.group());
|
||||
} else {
|
||||
this.proxy(this.regexp);
|
||||
}
|
||||
|
@ -91,8 +91,7 @@ export default class Regexper {
|
||||
|
||||
return Q.fcall(parser.parse.bind(parser), expression)
|
||||
.then((result) => {
|
||||
result.setContainer(snap.group());
|
||||
result.render();
|
||||
result.render(snap.group());
|
||||
return result;
|
||||
}, this.showError.bind(this))
|
||||
.then((result) => {
|
||||
|
Loading…
Reference in New Issue
Block a user