catch js error if the notification mid is for e.g. a like and class .item_123def... does not exist

This commit is contained in:
Mario Vavti 2016-09-27 14:00:04 +02:00
parent 01842a563d
commit fc18bea4bd

View File

@ -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);