From 10e2151e445a607566a325bcce0f9478c83adfb3 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 20 Feb 2014 00:03:35 +0800 Subject: Bug 974393: comment tag link is collapsing all comments including those with the tag --- js/comments.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/comments.js b/js/comments.js index 2264375eb..63bf5c887 100644 --- a/js/comments.js +++ b/js/comments.js @@ -55,13 +55,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); + } } } -- cgit v1.2.3-24-g4f1b