diff options
author | Byron Jones <glob@mozilla.com> | 2014-06-16 09:57:42 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-06-16 09:57:42 +0200 |
commit | dd10df6857319589e15cc404ad8690cdf54a6768 (patch) | |
tree | f205759b650de1f72727c0b6dbcf8545e472d9af /js | |
parent | 9916f57f9b56b50aaa82cdfa8fdd6a0c2d46f5d2 (diff) | |
download | bugzilla-dd10df6857319589e15cc404ad8690cdf54a6768.tar.gz bugzilla-dd10df6857319589e15cc404ad8690cdf54a6768.tar.xz |
Bug 956892: collapsed comments should display tags to indicate the reason for auto-collapsing
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 63bf5c887..12bc00d46 100644 --- a/js/comments.js +++ b/js/comments.js @@ -38,11 +38,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) { @@ -76,6 +76,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'); } |