Code coverage report for lib/attributes/script.js

Statements: 100% (15 / 15)      Branches: 87.5% (7 / 8)      Functions: 75% (3 / 4)      Lines: 100% (12 / 12)      Ignored: none     

All files » lib/attributes/ » script.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 35 36 37 38 39 40 41 421         1           9 9   9 8 5 4 4     8     9                           1      
var BaseAttribute = require("./base");
 
/**
 */
 
module.exports = BaseAttribute.extend({
 
  /**
   */
 
  bind: function() {
    BaseAttribute.prototype.bind.call(this);
    var self = this;
 
    if (this.value.watch) {
      this._binding = this.value.watch(this.view, function(nv) {
        if (nv === self.currentValue) return;
        self.currentValue = nv;
        self.view.runloop.deferOnce(self);
      });
 
      this.currentValue = this.value.evaluate(this.view);
    }
 
    if (this.currentValue != null) this.update();
  },
 
  /**
   */
 
  update: function() {
 
  },
 
  /**
   */
 
  unbind: function() {
    Eif (this._binding) this._binding.dispose();
  }
});