aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-09-26 11:26:13 +0200
committerMario Vavti <mario@mariovavti.com>2016-09-26 11:26:13 +0200
commit8bf03d21cd329ed0804ea02e6ebfe06714f2a498 (patch)
treec94b05d66b2596d5df32dddd2a2af3f5bd270d85 /view/js
parent62229d0a49083be7e238a2511396031a0be03bd8 (diff)
downloadvolse-hubzilla-8bf03d21cd329ed0804ea02e6ebfe06714f2a498.tar.gz
volse-hubzilla-8bf03d21cd329ed0804ea02e6ebfe06714f2a498.tar.bz2
volse-hubzilla-8bf03d21cd329ed0804ea02e6ebfe06714f2a498.zip
catch js error if there are no collapsed comments
Diffstat (limited to 'view/js')
-rw-r--r--view/js/main.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 1c6798c36..b5bbd57b5 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -654,10 +654,12 @@ function updateConvItems(mode,data) {
// auto-scroll to a particular comment in a thread (designated by mid) when in single-thread mode
if(bParam_mid && mode == 'replace') {
$('html, body').animate({ scrollTop: $('.item_' + bParam_mid.substring(0,32)).offset().top }, 'slow');
- var scrolltoid = $('.collapsed-comments').attr('id').substring(19);
- $('#collapsed-comments-' + scrolltoid).slideDown();
- $('#hide-comments-' + scrolltoid).html(aStr.showfewer);
- $('#hide-comments-total-' + scrolltoid).hide();
+ if($('.collapsed-comments').length) {
+ var scrolltoid = $('.collapsed-comments').attr('id').substring(19);
+ $('#collapsed-comments-' + scrolltoid).slideDown();
+ $('#hide-comments-' + scrolltoid).html(aStr.showfewer);
+ $('#hide-comments-total-' + scrolltoid).hide();
+ }
}
}