From fc18bea4bd125562038a5ca9c584729b54a44ab7 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Tue, 27 Sep 2016 14:00:04 +0200 Subject: catch js error if the notification mid is for e.g. a like and class .item_123def... does not exist --- view/js/main.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'view/js/main.js') diff --git a/view/js/main.js b/view/js/main.js index b5bbd57b5..c1536bce8 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -652,7 +652,8 @@ 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') { + if($('.item_' + bParam_mid.substring(0,32)).length && mode == 'replace') { + console.log($('.item_' + bParam_mid.substring(0,32))); $('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); -- cgit v1.2.3