allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject git commit: [#5991] select checkout command on first click, but not subsequent clicks within it
Date Wed, 20 Mar 2013 19:30:33 GMT
Updated Branches:
  refs/heads/db/5991 [created] c142bd989


[#5991] select checkout command on first click, but not subsequent clicks within it


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/c142bd98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c142bd98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c142bd98

Branch: refs/heads/db/5991
Commit: c142bd989df2ef6faf9ed8bd40d0cd1ae3998920
Parents: d882b0b
Author: Dave Brondsema <dbrondsema@geek.net>
Authored: Wed Mar 20 19:30:13 2013 +0000
Committer: Dave Brondsema <dbrondsema@geek.net>
Committed: Wed Mar 20 19:30:13 2013 +0000

----------------------------------------------------------------------
 Allura/allura/public/nf/js/allura-base.js |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c142bd98/Allura/allura/public/nf/js/allura-base.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/allura-base.js b/Allura/allura/public/nf/js/allura-base.js
index d1ae083..6fa3fd4 100644
--- a/Allura/allura/public/nf/js/allura-base.js
+++ b/Allura/allura/public/nf/js/allura-base.js
@@ -96,7 +96,14 @@ $(function(){
             }
         }).
         blur();
-    $('.selectText').click(function(){this.select()});
+    $('.selectText').focus(function(){
+        var field = $(this);
+        // running select() directly doesn't work for Chrome
+        // http://stackoverflow.com/questions/3150275/jquery-input-select-all-on-focus/3150369#3150369
+        window.setTimeout(function() {
+            field.select();
+        }, 0);
+    });
 });
 
 function auto_close( o, timeout ){


Mime
View raw message