summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-10-04 07:29:07 +0200
committerByron Jones <bjones@mozilla.com>2012-10-04 07:29:07 +0200
commit0b7ca5cd29d9fae16326eb059caf75dc54876155 (patch)
tree2e67f3e2dfafce4689ddcdb970dc7571586979c9 /js
parente9b93e7519656a29da28a859ffee69667b7a440a (diff)
downloadbugzilla-0b7ca5cd29d9fae16326eb059caf75dc54876155.tar.gz
bugzilla-0b7ca5cd29d9fae16326eb059caf75dc54876155.tar.xz
Bug 713796: "Reset Assignee to default" and "Reset QA Contact to default" should only be checked when the assignee/qa-contact is the default
Diffstat (limited to 'js')
-rw-r--r--js/field.js22
1 files changed, 14 insertions, 8 deletions
diff --git a/js/field.js b/js/field.js
index a17fbbb3a..d42fb0c63 100644
--- a/js/field.js
+++ b/js/field.js
@@ -343,13 +343,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]);
}
}
@@ -446,7 +452,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 ) {