1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 1 1 1 | var BaseComponent = require("./base"); /** */ function ShowComponent(options) { BaseComponent.call(this, options); } /** */ module.exports = BaseComponent.extend(ShowComponent, { /** */ update: function() { var show = !!this.attributes.when; if (this._show === show) return; this._show = show; if (show) { this._view = this.childTemplate.view(this.view.context); this.section.appendChild(this._view.render()); } else { if (this._view) this._view.dispose(); this._view = void 0; } } }); |