Changed notification display.

This commit is contained in:
Quentin Decaunes 2019-02-28 08:07:57 +01:00
parent 63d016cd63
commit 32089ec336
2 changed files with 8 additions and 11 deletions

View File

@ -16,9 +16,6 @@
<li><a href="#">Presets</a></li> <li><a href="#">Presets</a></li>
<li><a href="#">Logs</a></li> <li><a href="#">Logs</a></li>
</ul> </ul>
<div class="uk-container" id="notification-zone"></div>
<ul class="uk-switcher uk-margin"> <ul class="uk-switcher uk-margin">

View File

@ -81,11 +81,11 @@ function checkForAdminRights() {
* @param {string} message The message to be displayed, new line will be replaced by <br/>. * @param {string} message The message to be displayed, new line will be replaced by <br/>.
*/ */
function notification(type, message) { function notification(type, message) {
var element = parseHTML(` UIkit.notification({
<div class="uk-alert-${type}" uk-alert> message: (''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>'),
<a class="uk-alert-close" uk-close></a> status: type,
<p>${(''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>')}</p> pos: 'top-right',
</div>`); timeout: 5000
var notifZone = document.getElementById('notification-zone'); });
notifZone.appendChild(element[0]); }
}