summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-06-16 09:46:58 +0200
committerByron Jones <glob@mozilla.com>2014-06-16 09:46:58 +0200
commit384a1c6564bda9386c7488cb299289c3fbb81f3c (patch)
tree91d8b3e0bf05ff3f10d4920c9dc8721f19939f0a /js
parent80c434b3c9afec9ba606e5061ef042d3b96720d3 (diff)
downloadbugzilla-384a1c6564bda9386c7488cb299289c3fbb81f3c.tar.gz
bugzilla-384a1c6564bda9386c7488cb299289c3fbb81f3c.tar.xz
Bug 956892: collapsed comments should display tags to indicate the reason for auto-collapsing
r=gerv,a=sgreen
Diffstat (limited to 'js')
-rw-r--r--js/comments.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/comments.js b/js/comments.js
index 9150c72ec..43e6fe96e 100644
--- a/js/comments.js
+++ b/js/comments.js
@@ -23,11 +23,11 @@ function updateCommentPrivacy(checkbox, id) {
function toggle_comment_display(link, comment_id) {
var comment = document.getElementById('comment_text_' + comment_id);
- var re = new RegExp(/\bcollapsed\b/);
- if (comment.className.match(re))
+ if (YAHOO.util.Dom.hasClass(comment, 'collapsed')) {
expand_comment(link, comment, comment_id);
- else
+ } else {
collapse_comment(link, comment, comment_id);
+ }
}
function toggle_all_comments(action) {
@@ -61,6 +61,8 @@ function collapse_comment(link, comment, comment_id) {
function expand_comment(link, comment, comment_id) {
link.innerHTML = "[&minus;]";
+ YAHOO.util.Dom.addClass('cr' + comment_id, 'collapsed');
+ YAHOO.util.Dom.removeClass('c' + comment_id, 'bz_default_collapsed');
YAHOO.util.Dom.removeClass(comment, 'collapsed');
YAHOO.util.Dom.removeClass('comment_tag_' + comment_id, 'collapsed');
}