* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/
-import * as Language from "../Language";
+import { getPageOverlayContainer } from "../Helper/PageOverlay";
+import { getPhrase } from "../Language";
type Callback = () => void;
_message.addEventListener("click", hide);
_notificationElement.appendChild(_message);
- document.body.appendChild(_notificationElement);
+ getPageOverlayContainer().appendChild(_notificationElement);
}
/**
_callback = typeof callback === "function" ? callback : null;
_message.className = cssClassName || "success";
- _message.textContent = Language.get(message || "wcf.global.success");
+ _message.textContent = getPhrase(message || "wcf.global.success");
_notificationElement.classList.add("active");
_timeout = setTimeout(hide, 2000);
* @copyright 2001-2019 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
*/
-define(["require", "exports", "tslib", "../Language"], function (require, exports, tslib_1, Language) {
+define(["require", "exports", "../Helper/PageOverlay", "../Language"], function (require, exports, PageOverlay_1, Language_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.show = void 0;
- Language = tslib_1.__importStar(Language);
let _busy = false;
let _callback = null;
let _didInit = false;
_message = document.createElement("p");
_message.addEventListener("click", hide);
_notificationElement.appendChild(_message);
- document.body.appendChild(_notificationElement);
+ (0, PageOverlay_1.getPageOverlayContainer)().appendChild(_notificationElement);
}
/**
* Hides the notification and invokes the callback if provided.
init();
_callback = typeof callback === "function" ? callback : null;
_message.className = cssClassName || "success";
- _message.textContent = Language.get(message || "wcf.global.success");
+ _message.textContent = (0, Language_1.getPhrase)(message || "wcf.global.success");
_notificationElement.classList.add("active");
_timeout = setTimeout(hide, 2000);
}