]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 448696 - "(edit)" links should focus the text box and select all text in them
authorguy.pyrzak%gmail.com <>
Fri, 5 Sep 2008 03:00:53 +0000 (03:00 +0000)
committerguy.pyrzak%gmail.com <>
Fri, 5 Sep 2008 03:00:53 +0000 (03:00 +0000)
 Patch By Guy Pyrzak <guy.pyrzak@gmail.com> r=mkanat, a=mkanat

js/field.js

index 15b5d4f7940e2464d3b4357f015cb63919c0c12b..69f2eeba9038bc9c70b3486f7157c79e6aa32426 100644 (file)
@@ -161,6 +161,12 @@ function hideEditableField( container, input, action, field_id, original_value )
 function showEditableField (e, ContainerInputArray) {
     YAHOO.util.Dom.setStyle(ContainerInputArray[0], 'display', 'none');
     YAHOO.util.Dom.setStyle(ContainerInputArray[1], 'display', 'inline');
+    var inputs = YAHOO.util.Dom.get(ContainerInputArray[1]).getElementsByTagName('input')
+    if( inputs.length > 0) {
+        // focus on the first field, this makes it easier to edit
+        inputs[0].focus();
+        inputs[0].select();
+    }
     YAHOO.util.Event.preventDefault(e);
 }