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="#">Logs</a></li>
</ul>
<div class="uk-container" id="notification-zone"></div>
<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/>.
*/
function notification(type, message) {
var element = parseHTML(`
<div class="uk-alert-${type}" uk-alert>
<a class="uk-alert-close" uk-close></a>
<p>${(''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>')}</p>
</div>`);
var notifZone = document.getElementById('notification-zone');
notifZone.appendChild(element[0]);
}
UIkit.notification({
message: (''+message).replace(/(?:\r\n|\r|\n)/g, '<br/>'),
status: type,
pos: 'top-right',
timeout: 5000
});
}