diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-05-10 16:44:47 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-05-10 16:44:47 +0200 |
commit | cd478d226e183efc30939fb13f797bd012117405 (patch) | |
tree | 6a279e006cc18053c4d4e27eff77c3f9d119940d /js | |
parent | f92a5f03ea670c89be57ccdb16dba276099abdc5 (diff) | |
download | bugzilla-cd478d226e183efc30939fb13f797bd012117405.tar.gz bugzilla-cd478d226e183efc30939fb13f797bd012117405.tar.xz |
Bug 850135 - hide the textarea custom fields by default with an (edit) link
r=glob,a=LpSolit
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/js/field.js b/js/field.js index c0d0aaa6e..900299ee0 100644 --- a/js/field.js +++ b/js/field.js @@ -214,14 +214,14 @@ function setupEditLink(id) { } /* Hide input/select fields and show the text with (edit) next to it */ -function hideEditableField( container, input, action, field_id, original_value, new_value ) { +function hideEditableField( container, input, action, field_id, original_value, new_value, hide_input ) { 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, field_id, new_value)); if(field_id != ""){ YAHOO.util.Event.addListener(window, 'load', checkForChangedFieldValues, - new Array(container, input, field_id, original_value)); + new Array(container, input, field_id, original_value, hide_input )); } } @@ -269,7 +269,7 @@ function showEditableField (e, ContainerInputArray) { } // focus on the first field, this makes it easier to edit inputs[0].focus(); - if ( type == "input" ) { + if ( type == "input" || type == "textarea" ) { inputs[0].select(); } } @@ -293,8 +293,10 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { var el = document.getElementById(ContainerInputArray[2]); var unhide = false; if ( el ) { - if ( el.value != ContainerInputArray[3] || - ( el.value == "" && el.id != "alias" && el.id != 'qa_contact') ) { + if ( !ContainerInputArray[4] + && (el.value != ContainerInputArray[3] + || (el.value == "" && el.id != "alias" && el.id != "qa_contact")) ) + { unhide = true; } else { @@ -303,7 +305,7 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { if ( set_default ) { if(set_default.checked){ unhide = true; - } + } } } } |