]> 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:39:56 +0000 (01:39 -0500)
committerDavid Lawrence <dlawrence@mozilla.com>
Fri, 21 Jan 2011 06:39:56 +0000 (01:39 -0500)
r/a=mkanat

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

index 0be16c3874f1ab5e49aa6f9809bd79414e3eea07..3d1aa429fa6a171b451d6972ab5db7aceda850e2 100644 (file)
@@ -432,11 +432,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 618727fee7465533e1f786100f667212c740f3a4..d81523742aceb96f8e3fdecc76741432583772be 100644 (file)
@@ -586,7 +586,8 @@ TUI_hide_default('expert_fields');
       <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 badd5dfb8c3d33f9975dc462d2aaf9c8708e05b1..b1e5f7b8864bcd515afcd8a5ece190df38b6939b 100644 (file)
@@ -70,6 +70,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)