Skip to content

Commit

Permalink
Update style and documentation comment for selectOnFocus patch, switc…
Browse files Browse the repository at this point in the history
…h to use enyo.AsyncMethod

Enyo-DCO-1.0-Signed-Off-By: Ben Combee (ben.combee@palm.com)
  • Loading branch information
unwiredben committed Oct 17, 2012
1 parent 8e5768b commit 265b814
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions source/ui/Input.js
Expand Up @@ -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: {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 265b814

Please sign in to comment.