summaryrefslogtreecommitdiffstats
path: root/js/field.js
diff options
context:
space:
mode:
authorDavid Lawrence <dlawrence@mozilla.com>2011-01-21 05:46:40 +0100
committerDavid Lawrence <dlawrence@mozilla.com>2011-01-21 05:46:40 +0100
commitbb5a73e5b97c4b73fc14c66afb939aac55c71990 (patch)
tree98d901324f21193b2fbc7a4b60cc7c49645e98bc /js/field.js
parentfc329ec4b1f0ad1adfe73f8f5adeca308f296977 (diff)
downloadbugzilla-bb5a73e5b97c4b73fc14c66afb939aac55c71990.tar.gz
bugzilla-bb5a73e5b97c4b73fc14c66afb939aac55c71990.tar.xz
Bug 626658 - Add (take) link to bug edit page to allow quick assigning to the current user
r/a=mkanat
Diffstat (limited to 'js/field.js')
-rw-r--r--js/field.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/js/field.js b/js/field.js
index 6d78a60ce..aa9cd6c7e 100644
--- a/js/field.js
+++ b/js/field.js
@@ -211,11 +211,11 @@ function setupEditLink(id) {
}
/* Hide input fields and show the text with (edit) next to it */
-function hideEditableField( container, input, action, field_id, original_value ) {
+function hideEditableField( container, input, action, field_id, original_value, new_value ) {
YAHOO.util.Dom.removeClass(container, 'bz_default_hidden');
YAHOO.util.Dom.addClass(input, 'bz_default_hidden');
YAHOO.util.Event.addListener(action, 'click', showEditableField,
- new Array(container, input));
+ new Array(container, input, new_value));
if(field_id != ""){
YAHOO.util.Event.addListener(window, 'load', checkForChangedFieldValues,
new Array(container, input, field_id, original_value));
@@ -227,9 +227,9 @@ function hideEditableField( container, input, action, field_id, original_value )
*
* var e: the event
* var ContainerInputArray: An array containing the (edit) and text area and the input being displayed
- * var ContainerInputArray[0]: the conainer that will be hidden usually shows the (edit) text
+ * var ContainerInputArray[0]: the container that will be hidden usually shows the (edit) or (take) text
* var ContainerInputArray[1]: the input area and label that will be displayed
- *
+ * var ContainerInputArray[2]: the new value to set the input field to when (take) is clicked
*/
function showEditableField (e, ContainerInputArray) {
var inputs = new Array();
@@ -246,6 +246,11 @@ function showEditableField (e, ContainerInputArray) {
inputs = inputArea.getElementsByTagName('input');
}
if ( inputs.length > 0 ) {
+ // Change the first field's value to ContainerInputArray[2]
+ // if present before focusing.
+ if (ContainerInputArray[2]) {
+ inputs[0].value = ContainerInputArray[2];
+ }
// focus on the first field, this makes it easier to edit
inputs[0].focus();
inputs[0].select();