Commit ddb10035 authored by Byron Jones's avatar Byron Jones

Bug 797680: make "reset assignee/qa-contact to default" unchecked if the…

Bug 797680: make "reset assignee/qa-contact to default" unchecked if the assignee/qa-contact has changed from defaults r=LpSolit, r=LpSolit
parent fa48b7a2
...@@ -336,13 +336,19 @@ function showPeopleOnChange( field_id_list ) { ...@@ -336,13 +336,19 @@ function showPeopleOnChange( field_id_list ) {
} }
} }
function assignToDefaultOnChange(field_id_list) { function assignToDefaultOnChange(field_id_list, default_assignee, default_qa_contact) {
showPeopleOnChange( field_id_list ); showPeopleOnChange(field_id_list);
for(var i = 0; i < field_id_list.length; i++) { for(var i = 0, l = field_id_list.length; i < l; i++) {
YAHOO.util.Event.addListener( field_id_list[i],'change', setDefaultCheckbox, YAHOO.util.Event.addListener(field_id_list[i], 'change', function(evt, defaults) {
'set_default_assignee'); if (document.getElementById('assigned_to').value == defaults[0]) {
YAHOO.util.Event.addListener( field_id_list[i],'change',setDefaultCheckbox, setDefaultCheckbox(evt, 'set_default_assignee');
'set_default_qa_contact'); }
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) { ...@@ -439,7 +445,7 @@ function setResolutionToDuplicate(e, duplicate_or_move_bug_status) {
YAHOO.util.Event.preventDefault(e); YAHOO.util.Event.preventDefault(e);
} }
function setDefaultCheckbox(e, field_id ) { function setDefaultCheckbox(e, field_id) {
var el = document.getElementById(field_id); var el = document.getElementById(field_id);
var elLabel = document.getElementById(field_id + "_label"); var elLabel = document.getElementById(field_id + "_label");
if( el && elLabel ) { if( el && elLabel ) {
......
...@@ -283,9 +283,6 @@ ...@@ -283,9 +283,6 @@
bug = bug, field = bug_fields.op_sys, bug = bug, field = bug_fields.op_sys,
no_tds = 1, value = bug.op_sys no_tds = 1, value = bug.op_sys
editable = bug.check_can_change_field('op_sys', 0, 1) %] editable = bug.check_can_change_field('op_sys', 0, 1) %]
<script type="text/javascript">
assignToDefaultOnChange(['product', 'component']);
</script>
</td> </td>
</tr> </tr>
...@@ -464,6 +461,11 @@ ...@@ -464,6 +461,11 @@
</td> </td>
</tr> </tr>
[% END %] [% END %]
<script type="text/javascript">
assignToDefaultOnChange(['product', 'component'],
'[% bug.component_obj.default_assignee.login FILTER js %]',
'[% bug.component_obj.default_qa_contact.login FILTER js %]');
</script>
[% END %] [% END %]
[%############################################################################%] [%############################################################################%]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment