Commit ad9b1495 authored by Byron Jones's avatar Byron Jones

Bug 974411: js/comments.js::toggle_all_comments() shouldn't try to match

non-comment elements r=gerv, a=glob
parent 3ef245b2
...@@ -40,13 +40,16 @@ function toggle_all_comments(action) { ...@@ -40,13 +40,16 @@ function toggle_all_comments(action) {
var comment = comments[i]; var comment = comments[i];
if (!comment) if (!comment)
continue; continue;
var id = comment.id.match(/^comment_text_(\d*)$/);
var id = comments[i].id.match(/\d*$/); if (!id)
continue;
id = id[1];
var link = document.getElementById('comment_link_' + id); var link = document.getElementById('comment_link_' + id);
if (action == 'collapse') if (action == 'collapse') {
collapse_comment(link, comment, id); collapse_comment(link, comment, id);
else } else {
expand_comment(link, comment, id); expand_comment(link, comment, id);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment