# Code coverage report for lib/attributes/script.js

## Statements: 100% (13 / 13) Branches: 100% (4 / 4) Functions: 75% (3 / 4) Lines: 100% (11 / 11) 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
    381

    1

    22
    22

    22
    1015
    270
    270

    22
    22

    5

     var BaseAttribute = require("./base");

    /**
     */

    module.exports = BaseAttribute.extend({

      /**
       */

      bind: function() {
        BaseAttribute.prototype.bind.call(this);
        var self = this;

        this._binding = this.value.bind(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() {
        this._binding.dispose();
      }
    });