diff options
author | Byron Jones <bjones@mozilla.com> | 2012-10-16 15:17:06 +0800 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2012-10-16 15:17:06 +0800 |
commit | 56eee673109222902bd03daaccd5b36076eec5b9 (patch) | |
tree | f03adfa21b69d2d3b48963ea879dbdacf255fd0c /js | |
parent | Bug 801569: Require DBD::Pg 2.7.0 to correctly work with PostgreSQL 8.3 (diff) | |
download | bugzilla-56eee673109222902bd03daaccd5b36076eec5b9.tar.gz bugzilla-56eee673109222902bd03daaccd5b36076eec5b9.tar.bz2 bugzilla-56eee673109222902bd03daaccd5b36076eec5b9.zip |
Bug 797680: make "reset assignee/qa-contact to default" unchecked if the assignee/qa-contact has changed from defaults
r=LpSolit, r=LpSolit
Diffstat (limited to 'js')
-rw-r--r-- | js/field.js | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/js/field.js b/js/field.js index 7d47169d4..c0d0aaa6e 100644 --- a/js/field.js +++ b/js/field.js @@ -336,13 +336,19 @@ function showPeopleOnChange( field_id_list ) { } } -function assignToDefaultOnChange(field_id_list) { - showPeopleOnChange( field_id_list ); - for(var i = 0; i < field_id_list.length; i++) { - YAHOO.util.Event.addListener( field_id_list[i],'change', setDefaultCheckbox, - 'set_default_assignee'); - YAHOO.util.Event.addListener( field_id_list[i],'change',setDefaultCheckbox, - 'set_default_qa_contact'); +function assignToDefaultOnChange(field_id_list, default_assignee, default_qa_contact) { + showPeopleOnChange(field_id_list); + for(var i = 0, l = field_id_list.length; i < l; i++) { + YAHOO.util.Event.addListener(field_id_list[i], 'change', function(evt, defaults) { + if (document.getElementById('assigned_to').value == defaults[0]) { + setDefaultCheckbox(evt, 'set_default_assignee'); + } + if (document.getElementById('qa_contact') + && document.getElementById('qa_contact').value == defaults[1]) + { + setDefaultCheckbox(evt, 'set_default_qa_contact'); + } + }, [default_assignee, default_qa_contact]); } } @@ -439,7 +445,7 @@ function setResolutionToDuplicate(e, duplicate_or_move_bug_status) { YAHOO.util.Event.preventDefault(e); } -function setDefaultCheckbox(e, field_id ) { +function setDefaultCheckbox(e, field_id) { var el = document.getElementById(field_id); var elLabel = document.getElementById(field_id + "_label"); if( el && elLabel ) { |