Skip to content

Node.js based forum software built for the modern web

fix: bookmark scroll doing ajaxify

Barış Soner Uşaklı2e0964e6fe3b
diff --git a/public/src/client/topic.js b/public/src/client/topic.js
index c3fc08a76f..571f66e4d9 100644
--- a/public/src/client/topic.js
+++ b/public/src/client/topic.js
@@ -162,7 +162,7 @@ define('forum/topic', [
timeout: 15000,
type: 'info',
clickfn: function () {
- navigator.scrollToIndex(parseInt(bookmark, 10), true);
+ navigator.scrollToIndex(Math.max(0, parseInt(bookmark, 10) - 1), true);
},
closefn: function () {
storage.removeItem('topic:' + tid + ':bookmark');
diff --git a/public/src/modules/alerts.js b/public/src/modules/alerts.js
index ae30c6c6b3..725772f5a3 100644
--- a/public/src/modules/alerts.js
+++ b/public/src/modules/alerts.js
@@ -90,8 +90,8 @@ function updateAlert(alert, params) {
.on('click', function (e) {
if (!$(e.target).is('.btn-close')) {
params.clickfn();
+ close(alert);
}
- close(alert);
});
}
}
@@ -128,8 +128,8 @@ function createNew(params) {
.on('click', function (e) {
if (!$(e.target).is('.btn-close')) {
params.clickfn(alert, params);
+ close(alert);
}
- close(alert);
});
}