1
0
mirror of https://github.com/SuperBFG7/ympd synced 2024-12-27 11:20:26 +00:00

Click hides notification

This commit is contained in:
jcorporation 2018-07-11 00:12:36 +01:00
parent 1c0c9aa14f
commit 69d95a8ab1

View File

@ -1389,6 +1389,9 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no
if (!document.getElementById('alertBox')) {
alertBox = document.createElement('div');
alertBox.setAttribute('id', 'alertBox');
alertBox.addEventListener('click', function() {
hideNotification();
}, false);
}
else {
alertBox = document.getElementById('alertBox');
@ -1400,15 +1403,20 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no
if (alertTimeout)
clearTimeout(alertTimeout);
alertTimeout = setTimeout(function() {
if (document.getElementById('alertBox'))
document.getElementById('alertBox').classList.remove('alertBoxActive');
setTimeout(function() {
document.getElementById('alertBox').remove();
}, 600);
hideNotification();
}, 3000);
}
}
function hideNotification() {
if (document.getElementById('alertBox')) {
document.getElementById('alertBox').classList.remove('alertBoxActive');
setTimeout(function() {
document.getElementById('alertBox').remove();
}, 600);
}
}
function notificationsSupported() {
return "Notification" in window;
}