mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: bookmark scroll doing ajaxify
if target post is already on page fix alerts crash due to double close
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user