From 02895c272375a5e32f4512e770b85c331e5fe9a4 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Sat, 25 May 2013 01:02:18 -0500 Subject: [PATCH] Select entire textbox when autofocusing --- js/client.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/js/client.js b/js/client.js index 34168a982..ac2c8dd9e 100644 --- a/js/client.js +++ b/js/client.js @@ -1197,7 +1197,7 @@ } if (popup.domInitialize) popup.domInitialize(data); - popup.$('.autofocus').focus(); + popup.$('.autofocus').select().focus(); if ($overlay) $overlay.scrollTop(0); this.popups.push(popup); return popup; @@ -1824,12 +1824,6 @@ submit: function(data) { this.close(); app.user.rename(data.username); - }, - domInitialize: function() { - var $input = this.$('input[name=username]'); - if ('setSelectionRange' in $input[0]) { - $input[0].setSelectionRange(0, $input.val().length); - } } });