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

## Statements: 25% (2 / 8) Branches: 0% (0 / 4) Functions: 0% (0 / 2) Lines: 25% (2 / 8) Ignored: none

All files » lib/attributes/ » 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
    311

    1

     var ScriptAttribute = require("./script");

    /**
     * Conflict with show component
     */

    module.exports = ScriptAttribute.extend({

      /**
       */

      initialize: function () {
        this._displayStyle = this.node.style.display;
      },

      /**
       */

      update: function () {

        var value = this.currentValue;

        var state = value ? this._displayStyle : "none";

        if (this.node.__isNode) {
          this.node.style.setProperties({ display: state })
        } else {
          this.node.style.display = state;
        }
      }
    });