mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-09 14:02:40 +02:00
fix 0 timeouts
This commit is contained in:
@@ -160,7 +160,7 @@ define('forum/topic', [
|
||||
alerts.alert({
|
||||
alert_id: 'bookmark',
|
||||
message: '[[topic:bookmark_instructions]]',
|
||||
timeout: 0,
|
||||
timeout: 15000,
|
||||
type: 'info',
|
||||
clickfn: function () {
|
||||
navigator.scrollToIndex(parseInt(bookmark, 10), true);
|
||||
@@ -169,9 +169,6 @@ define('forum/topic', [
|
||||
storage.removeItem('topic:' + tid + ':bookmark');
|
||||
},
|
||||
});
|
||||
setTimeout(function () {
|
||||
alerts.remove('bookmark');
|
||||
}, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ export function success(message, timeout) {
|
||||
title: '[[global:alert.success]]',
|
||||
message: message,
|
||||
type: 'success',
|
||||
timeout: timeout || 5000,
|
||||
timeout: timeout !== undefined ? timeout : 5000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ export function info(message, timeout) {
|
||||
title: '[[global:alert.info]]',
|
||||
message: message,
|
||||
type: 'info',
|
||||
timeout: timeout || 5000,
|
||||
timeout: timeout !== undefined ? timeout : 5000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ export function warning(message, timeout) {
|
||||
title: '[[global:alert.warning]]',
|
||||
message: message,
|
||||
type: 'warning',
|
||||
timeout: timeout || 5000,
|
||||
timeout: timeout !== undefined ? timeout : 5000,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ function createNew(params) {
|
||||
}
|
||||
});
|
||||
|
||||
if (params.timeout) {
|
||||
if (parseInt(params.timeout, 10)) {
|
||||
startTimeout(alert, params);
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ function close(alert) {
|
||||
}
|
||||
|
||||
function startTimeout(alert, params) {
|
||||
const timeout = params.timeout;
|
||||
const timeout = parseInt(params.timeout, 10);
|
||||
|
||||
const timeoutId = setTimeout(function () {
|
||||
alert.removeAttr('timeoutId');
|
||||
|
||||
Reference in New Issue
Block a user