]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 626292: "Make description private" checkbox should set bz_private class on the...
authorDavid Lawrence <dlawrence@mozilla.com>
Fri, 21 Jan 2011 06:35:50 +0000 (01:35 -0500)
committerDavid Lawrence <dlawrence@mozilla.com>
Fri, 21 Jan 2011 06:35:50 +0000 (01:35 -0500)
r/a=mkanat

js/field.js
template/en/default/bug/create/create.html.tmpl
template/en/default/bug/edit.html.tmpl

index aa9cd6c7e078dc352eda31ba31b74ee2540f21bd..621cdf3eba99caa68a0dc602333db18ebb781a41 100644 (file)
@@ -443,11 +443,11 @@ function boldOnChange(e, field_id){
     }
 }
 
-function updateCommentTagControl(checkbox, form) {
+function updateCommentTagControl(checkbox, field) {
     if (checkbox.checked) {
-        form.comment.className='bz_private';
+        YAHOO.util.Dom.addClass(field, 'bz_private');
     } else {
-        form.comment.className='';
+        YAHOO.util.Dom.removeClass(field, 'bz_private');
     }
 }
 
index 94aafe45d972d73ccbf9adff85aea45bd71f705f..a2e7b7eaed51a4aab076b89162f0ff014f00ecd9 100644 (file)
@@ -589,7 +589,8 @@ TUI_hide_default('attachment_text_field');
       <td colspan="3">
         &nbsp;&nbsp;
         <input type="checkbox" id="comment_is_private" name="comment_is_private"
-          [% ' checked="checked"' IF comment_is_private %]>
+          [% ' checked="checked"' IF comment_is_private %]
+               onClick="updateCommentTagControl(this, 'comment')">
         <label for="comment_is_private">
           Make description private (visible only to members of the 
           <strong>[% Param('insidergroup') FILTER html %]</strong> group)
index e8eaaad1f019436838df584412e79184c8440727..1ae71b29905ba5eb84f1a78803c95fc2618c69b2 100644 (file)
@@ -60,6 +60,7 @@
     [% IF user.is_insider %]
       if (document.getElementById('isprivate_' + real_id).checked) {
           document.getElementById('newcommentprivacy').checked = 'checked';
+          updateCommentTagControl(document.getElementById('newcommentprivacy'), 'comment'); 
       }
     [% END %]
 
   //-->
   </script>
 
-<form name="changeform" method="post" action="process_bug.cgi">
+<form name="changeform" id="changeform" method="post" action="process_bug.cgi">
 
   <input type="hidden" name="delta_ts" value="[% bug.delta_ts %]">
   <input type="hidden" name="longdesclength" value="[% bug.comments.size %]">
       [% IF user.is_insider %]
         <input type="checkbox" name="comment_is_private" value="1"
                id="newcommentprivacy"
-               onClick="updateCommentTagControl(this, form)">
+               onClick="updateCommentTagControl(this, 'comment')">
         <label for="newcommentprivacy">
           Make comment private (visible only to members of the
           <strong>[% Param('insidergroup') FILTER html %]</strong> group)