summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorguy.pyrzak%gmail.com <>2008-09-05 04:34:43 +0200
committerguy.pyrzak%gmail.com <>2008-09-05 04:34:43 +0200
commita8283054a8ae41752770266fd05397869b12f257 (patch)
tree79f5a917db08b806837a4855328dbf6602ff0128 /js
parent6d67154b6d3464bb7af1264b0650c73d1f6e9f6f (diff)
downloadbugzilla-a8283054a8ae41752770266fd05397869b12f257.tar.gz
bugzilla-a8283054a8ae41752770266fd05397869b12f257.tar.xz
Bug 448696: "(edit)" links should focus the text box and select all text in them
Patch By Guy Pyrzak <guy.pyrzak@gmail.com> r=mkanat, a=mkanat
Diffstat (limited to 'js')
-rw-r--r--js/field.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/js/field.js b/js/field.js
index 15b5d4f79..69f2eeba9 100644
--- a/js/field.js
+++ b/js/field.js
@@ -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);
}