]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 310171 Update css for private comments in real-time
authorbugreport%peshkin.net <>
Fri, 7 Oct 2005 03:08:38 +0000 (03:08 +0000)
committerbugreport%peshkin.net <>
Fri, 7 Oct 2005 03:08:38 +0000 (03:08 +0000)
Patch by Andre Batosti <batosti@async.com.br>
r=joel, a=justdave

template/en/default/bug/comments.html.tmpl
template/en/default/bug/edit.html.tmpl

index 289593b7ac2e06b87543300468518e7dcd210438..163f3408df928a881177cc565f7f5f76af95f09f 100644 (file)
 
 [% PROCESS bug/time.html.tmpl %]
 
+  <script type="text/javascript">
+  <!--
+  function updateCommentPrivacy(checkbox, id) {
+    var text_elem = document.getElementById('comment_text_'+id);
+    if (checkbox.checked) {
+        text_elem.parentNode.className='bz_private';
+    } else {
+        text_elem.parentNode.className='';
+    }
+    document.refresh();
+  }
+  //-->
+  </script>
+
+
 [% DEFAULT start_at = 0 mode = "show" %]
 [% isinsider = Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
 [% sort_order = user.settings.comment_sort_order.value %]
                  value="[% comment.isprivate %]">
           <input type="hidden" name="when-[% count %]" value="[% comment.when %]">
           <input type="checkbox" name="isprivate-[% count %]" value="1"
+                 onClick="updateCommentPrivacy(this, [% count %])"
                  id="isprivate-[% count %]"
           [% " checked=\"checked\"" IF comment.isprivate %]> Private
         </i>
index 38b01f06e58d3f571f7f3aac584fb6f9904beb0b..940e320bddd08554906212679a0252d49f4b6d7f 100644 (file)
 
 [% END %]
 
+  function updateCommentTagControl(checkbox, form) {
+    if (checkbox.checked) {
+      form.comment.className='bz_private';
+    } else {
+      form.comment.className='';
+    }
+  }
+
   //-->
   </script>
 
   <b>Additional <u>C</u>omments:</b>
   [% IF Param("insidergroup") && UserInGroup(Param("insidergroup")) %]
     <input type="checkbox" name="commentprivacy" value="1"
-           id="newcommentprivacy"> Private
+           id="newcommentprivacy"
+           onClick="updateCommentTagControl(this, form)"> Private
   [% END %]
   <br>
   <a name="add_comment"></a>