diff options
author | Byron Jones <glob@mozilla.com> | 2014-06-16 15:46:58 +0800 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-06-16 15:46:58 +0800 |
commit | 384a1c6564bda9386c7488cb299289c3fbb81f3c (patch) | |
tree | 91d8b3e0bf05ff3f10d4920c9dc8721f19939f0a /js | |
parent | Bug 1012508 - Add a admin_menu hook to change who has access to admin.cgi (diff) | |
download | bugzilla-384a1c6564bda9386c7488cb299289c3fbb81f3c.tar.gz bugzilla-384a1c6564bda9386c7488cb299289c3fbb81f3c.tar.bz2 bugzilla-384a1c6564bda9386c7488cb299289c3fbb81f3c.zip |
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.js | 8 |
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 = "[−]"; + 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'); } |