summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rw-r--r--js/comments.js11
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);
+ }
}
}