fix go to post if its on page

v1.18.x
Barış Soner Uşaklı 7 years ago
parent f119ae3103
commit adc7054390

@ -117,10 +117,9 @@ define('notifications', ['sounds', 'translator', 'components', 'navigator', 'ben
function scrollToPostIndexIfOnPage(notifEl) {
// Scroll to index if already in topic (gh#5873)
var pid = notifEl.attr('data-pid');
var tid = notifEl.attr('data-tid');
var path = notifEl.attr('data-path');
var postEl = components.get('post', 'pid', pid);
if (path.startsWith(config.relative_path + '/post/') && pid && postEl.length && ajaxify.data.template.topic && parseInt(ajaxify.data.tid, 10) === parseInt(tid, 10)) {
if (path.startsWith(config.relative_path + '/post/') && pid && postEl.length && ajaxify.data.template.topic) {
navigator.scrollToIndex(postEl.attr('data-index'), true);
return true;
}

Loading…
Cancel
Save