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 | 1 1 | var ScriptAttribute = require("./script"); /** */ module.exports = ScriptAttribute.extend({ /** */ update: function() { if (!this.currentValue) return; if (this.node.focus) { var self = this; if (!process.browser) return this.node.focus(); // focus after being on screen. Need to break out // of animation, so setTimeout is the best option setTimeout(function() { self.node.focus(); }, 1); } } }); |