Node.js based forum software built for the modern web
fix 0 timeouts
Barış Soner Uşaklıe2a198c59a78
diff --git a/public/src/client/topic.js b/public/src/client/topic.jsindex 79235656dd..30d58e25c6 100644--- a/public/src/client/topic.js+++ b/public/src/client/topic.js@@ -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);}}diff --git a/public/src/modules/alerts.js b/public/src/modules/alerts.jsindex 3cc82137ca..ae30c6c6b3 100644--- a/public/src/modules/alerts.js+++ b/public/src/modules/alerts.js@@ -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');