aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-09-27 14:00:04 +0200
committerMario Vavti <mario@mariovavti.com>2016-09-27 14:00:04 +0200
commitfc18bea4bd125562038a5ca9c584729b54a44ab7 (patch)
tree9d1f2ddeefc479eccd70c1ba22a8b809b6b564e0
parent01842a563de07e2d389c060bd196f0af21ed3549 (diff)
downloadvolse-hubzilla-fc18bea4bd125562038a5ca9c584729b54a44ab7.tar.gz
volse-hubzilla-fc18bea4bd125562038a5ca9c584729b54a44ab7.tar.bz2
volse-hubzilla-fc18bea4bd125562038a5ca9c584729b54a44ab7.zip
catch js error if the notification mid is for e.g. a like and class .item_123def... does not exist
-rw-r--r--view/js/main.js3
1 files changed, 2 insertions, 1 deletions
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);