mirror of
https://github.com/SuperBFG7/ympd
synced 2024-12-27 11:20:26 +00:00
Click hides notification
This commit is contained in:
parent
1c0c9aa14f
commit
69d95a8ab1
@ -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,12 +1403,17 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no
|
||||
if (alertTimeout)
|
||||
clearTimeout(alertTimeout);
|
||||
alertTimeout = setTimeout(function() {
|
||||
if (document.getElementById('alertBox'))
|
||||
hideNotification();
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
function hideNotification() {
|
||||
if (document.getElementById('alertBox')) {
|
||||
document.getElementById('alertBox').classList.remove('alertBoxActive');
|
||||
setTimeout(function() {
|
||||
document.getElementById('alertBox').remove();
|
||||
}, 600);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user