catch js error if there are no collapsed comments

This commit is contained in:
Mario Vavti 2016-09-26 11:26:13 +02:00
parent 62229d0a49
commit 8bf03d21cd

View file

@ -654,11 +654,13 @@ 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');
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();
}
}
}