From d260a1ec0c17444d6665c605741b2c76f4e25c53 Mon Sep 17 00:00:00 2001 From: bbaer Date: Mon, 14 Aug 2017 16:02:35 +0200 Subject: [PATCH 1/2] Added constant NO_TIMEOUT --- javascript/src/Alert.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/javascript/src/Alert.js b/javascript/src/Alert.js index 0579c790..0fc74d22 100644 --- a/javascript/src/Alert.js +++ b/javascript/src/Alert.js @@ -72,7 +72,7 @@ var QfqNS = QfqNS || {}; * @param {string} options.message message to be displayed * @param {string} [options.type] type of message, can be `"info"`, `"warning"`, or `"error"`. Default is `"info"`. * @param {number} [options.timeout] timeout in milliseconds. If timeout is less than or equal to 0, the alert - * won't timeout and stay open until dismissed by the user. Default `0`. + * won't timeout and stay open until dismissed by the user. Default `n.Alert.constants.NO_TIMEOUT`. * @param {boolean} [options.modal] whether or not alert is modal, i.e. prevent clicks anywhere but the dialog. * Default is `false`. * @param {object[]} options.buttons what buttons to display on alert. If empty array is provided, no buttons are @@ -92,14 +92,14 @@ var QfqNS = QfqNS || {}; this.buttons = arguments[2] || []; this.modal = false; // this.timeout < 1 means forever - this.timeout = 0; + this.timeout = n.Alert.constants.NO_TIMEOUT; } else { // new style this.message = options.message || "MESSAGE"; this.messageType = options.type || "info"; this.buttons = options.buttons || []; this.modal = options.modal || false; - this.timeout = options.timeout || 0; + this.timeout = options.timeout || n.Alert.constants.NO_TIMEOUT; } this.$alertDiv = null; @@ -117,7 +117,8 @@ var QfqNS = QfqNS || {}; n.Alert.constants = { alertContainerId: "qfqAlertContainer", alertContainerSelector: "#qfqAlertContainer", - jQueryAlertRemoveEventName: "qfqalert.remove:" + jQueryAlertRemoveEventName: "qfqalert.remove:", + NO_TIMEOUT: 0 }; /** -- GitLab From f70abe933ad48bc9010241fe49b41a84ca383b7f Mon Sep 17 00:00:00 2001 From: bbaer Date: Mon, 14 Aug 2017 16:22:28 +0200 Subject: [PATCH 2/2] #4120: Removed Timeout from Dirty Alert Message --- javascript/src/QfqForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/src/QfqForm.js b/javascript/src/QfqForm.js index 17fa9658..99e73277 100644 --- a/javascript/src/QfqForm.js +++ b/javascript/src/QfqForm.js @@ -249,7 +249,7 @@ var QfqNS = QfqNS || {}; message = new n.Alert({ message: obj.data.message, type: messageType, - timeout: 20000 + timeout: n.Alert.constants.NO_TIMEOUT }); message.show(); }; -- GitLab