diff options
author | Byron Jones <glob@mozilla.com> | 2014-04-09 17:21:04 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2014-04-09 17:21:04 +0200 |
commit | ad9b149541d21e6e4e782da9785ba5fd16e9ccc7 (patch) | |
tree | 4c9da6716ef52de6a7326d74d16568eb38b4f9c3 | |
parent | 3ef245b21a397e5253ba1bda607a1510245d5c09 (diff) | |
download | bugzilla-ad9b149541d21e6e4e782da9785ba5fd16e9ccc7.tar.gz bugzilla-ad9b149541d21e6e4e782da9785ba5fd16e9ccc7.tar.xz |
Bug 974411: js/comments.js::toggle_all_comments() shouldn't try to match
non-comment elements
r=gerv, a=glob
-rw-r--r-- | js/comments.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/js/comments.js b/js/comments.js index 8d314de15..9150c72ec 100644 --- a/js/comments.js +++ b/js/comments.js @@ -40,13 +40,16 @@ function toggle_all_comments(action) { var comment = comments[i]; if (!comment) continue; - - var id = comments[i].id.match(/\d*$/); + var id = comment.id.match(/^comment_text_(\d*)$/); + if (!id) + continue; + id = id[1]; var link = document.getElementById('comment_link_' + id); - if (action == 'collapse') + if (action == 'collapse') { collapse_comment(link, comment, id); - else + } else { expand_comment(link, comment, id); + } } } |