Commit fd682483 authored by bbaer's avatar bbaer
Browse files

Added constant NO_TIMEOUT

parent 664ace96
......@@ -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
};
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment