diff --git a/javascript/src/Alert.js b/javascript/src/Alert.js index 0bdf82b1876948797096db987fc1b7e95c1f093a..0579c79058bb4349bc6697cacbfc74c999f15d70 100644 --- a/javascript/src/Alert.js +++ b/javascript/src/Alert.js @@ -19,11 +19,7 @@ var QfqNS = QfqNS || {}; /** * Display a message. * - * Display one message on a page. Several instances can be used per page, which results in messages being - * stacked, with the latest message being at the bottom. - * - * The first instance displaying a message will append an `alert container` to the body. The last message being - * dismissed will remove the `alert container`. A typical call sequence might look like: + * A typical call sequence might look like: * * var alert = new QfqNS.Alert({ * message: "Text being displayed", @@ -115,20 +111,24 @@ var QfqNS = QfqNS || {}; this.timerId = null; this.eventEmitter = new EventEmitter(); - }; n.Alert.prototype.on = n.EventEmitter.onMixin; + n.Alert.constants = { + alertContainerId: "qfqAlertContainer", + alertContainerSelector: "#qfqAlertContainer", + jQueryAlertRemoveEventName: "qfqalert.remove:" + }; /** * * @private */ n.Alert.prototype.makeAlertContainerSingleton = function () { - var alertContainer = $("#qfqAlertContainer"); + var alertContainer = $(n.Alert.constants.alertContainerSelector); if (alertContainer.length === 0) { // No container so far, create one - alertContainer = $("