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,
|
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);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user