fix: bookmark scroll doing ajaxify

if target post is already on page
fix alerts crash due to double close
isekai-main
Barış Soner Uşaklı 1 year ago
parent a7a266d72c
commit 2e0964e6fe

@ -162,7 +162,7 @@ define('forum/topic', [
timeout: 15000, timeout: 15000,
type: 'info', type: 'info',
clickfn: function () { clickfn: function () {
navigator.scrollToIndex(parseInt(bookmark, 10), true); navigator.scrollToIndex(Math.max(0, parseInt(bookmark, 10) - 1), true);
}, },
closefn: function () { closefn: function () {
storage.removeItem('topic:' + tid + ':bookmark'); storage.removeItem('topic:' + tid + ':bookmark');

@ -90,8 +90,8 @@ function updateAlert(alert, params) {
.on('click', function (e) { .on('click', function (e) {
if (!$(e.target).is('.btn-close')) { if (!$(e.target).is('.btn-close')) {
params.clickfn(); params.clickfn();
}
close(alert); close(alert);
}
}); });
} }
} }
@ -128,8 +128,8 @@ function createNew(params) {
.on('click', function (e) { .on('click', function (e) {
if (!$(e.target).is('.btn-close')) { if (!$(e.target).is('.btn-close')) {
params.clickfn(alert, params); params.clickfn(alert, params);
}
close(alert); close(alert);
}
}); });
} }

Loading…
Cancel
Save