Reorganizing and cleanup of base Node code

This commit is contained in:
Jeff Avallone
2015-04-19 12:05:59 -04:00
parent 00376bc78a
commit 8796c1329c
2 changed files with 28 additions and 61 deletions
+17 -28
View File
@@ -59,6 +59,23 @@ export default class Node {
});
}
render(container) {
if (container) {
this.container = container;
}
if (this.proxy) {
return this.proxy.render(this.container);
} else {
this.state.renderCounter++;
return this._render()
.then(() => {
this.state.renderCounter--;
return this;
});
}
}
renderLabel(text) {
var group = this.container.group()
.addClass('label'),
@@ -82,34 +99,6 @@ export default class Node {
});
}
startRender() {
this.state.renderCounter++;
}
doneRender() {
this.state.renderCounter--;
}
render(container) {
if (container) {
this.container = container;
}
if (this.proxy) {
return this.proxy.render(this.container);
} else {
this.startRender();
return this._render()
.then(
() => {
this.doneRender();
return this;
},
null
);
}
}
renderLabeledBox(label, content, options) {
var label = this.container.text(0, 0, label)
.addClass([this.type, 'label'].join('-')),