]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 974411: js/comments.js::toggle_all_comments() shouldn't try to match
authorByron Jones <glob@mozilla.com>
Wed, 9 Apr 2014 15:21:04 +0000 (23:21 +0800)
committerByron Jones <glob@mozilla.com>
Wed, 9 Apr 2014 15:21:04 +0000 (23:21 +0800)
non-comment elements
r=gerv, a=glob

js/comments.js

index 8d314de15eab780c9e3848eeca84fb5232c95be7..9150c72ec06c812a5438d42a1c2b2888c2d29bdd 100644 (file)
@@ -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);
+        }
     }
 }