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

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

All files » lib/attributes/ » focus.js

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    241

    1

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

    /**
     */

    module.exports = ScriptAttribute.extend({

      /**
       */

      update: function() {
        if (!this.currentValue) return;
        if (this.node.focus) {
          var self = this;

          // focus after being on screen. Need to break out
          // of animation, so setTimeout is the best option
          setTimeout(function(){
            self.node.focus();
          }, 1);
        }
      }
    });