From 265b814e230d80d8b66388f9baf2dd5ea3f2f215 Mon Sep 17 00:00:00 2001 From: unwiredben Date: Wed, 17 Oct 2012 14:02:48 -0500 Subject: [PATCH] Update style and documentation comment for selectOnFocus patch, switch to use enyo.AsyncMethod Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com) --- source/ui/Input.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/ui/Input.js b/source/ui/Input.js index b5d16d3d5..d49639ea2 100644 --- a/source/ui/Input.js +++ b/source/ui/Input.js @@ -32,7 +32,7 @@ enyo.kind({ _disabled_ DOM attribute. */ disabled: false, - //* Selects the contents of the input when it gains focus + //* When true, select the contents of the input when it gains focus. selectOnFocus: false }, events: { @@ -108,17 +108,17 @@ enyo.kind({ dragstart: function() { return true; }, - focused:function() { - if(this.selectOnFocus) { - enyo.job(null, enyo.bind(this, "selectContents"), 10); + focused: function() { + if (this.selectOnFocus) { + enyo.asyncMethod(this, "selectContents"); } }, - selectContents:function() { + selectContents: function() { var n = this.hasNode(); - if(n && n.setSelectionRange) { + if (n && n.setSelectionRange) { n.setSelectionRange(0, n.value.length); - } else if(n && n.createTextRange) { + } else if (n && n.createTextRange) { var r = n.createTextRange(); r.expand("textedit"); r.select();