Code coverage report for lib/components/show.js

Statements: 21.43% (3 / 14)      Branches: 0% (0 / 6)      Functions: 0% (0 / 2)      Lines: 25% (3 / 12)      Ignored: none     

All files » lib/components/ » show.js
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 351         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;
    }
  }
});