Browse Source

Skip render for temporary components. Fixes #1941

pull/2031/head
Artur Arseniev 7 years ago
parent
commit
702ba828b1
  1. 17
      src/dom_components/view/ComponentView.js

17
src/dom_components/view/ComponentView.js

@ -282,15 +282,13 @@ module.exports = Backbone.View.extend({
* @private * @private
*/ */
updateScript() { updateScript() {
if (!this.model.get('script')) { const { model, em } = this;
return; if (!model.get('script')) return;
} em &&
em
var em = this.em; .get('Canvas')
if (em) { .getCanvasView()
var canvas = em.get('Canvas'); .updateScript(this);
canvas.getCanvasView().updateScript(this);
}
}, },
/** /**
@ -357,6 +355,7 @@ module.exports = Backbone.View.extend({
}, },
render() { render() {
if (this.modelOpt.temporary) return this;
this.renderAttributes(); this.renderAttributes();
this.renderChildren(); this.renderChildren();
this.updateScript(); this.updateScript();

Loading…
Cancel
Save