mirror of
				https://github.com/SuperBFG7/ympd
				synced 2025-10-31 13:53:00 +00:00 
			
		
		
		
	Click hides notification
This commit is contained in:
		| @@ -1389,6 +1389,9 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no | |||||||
|         if (!document.getElementById('alertBox')) { |         if (!document.getElementById('alertBox')) { | ||||||
|             alertBox = document.createElement('div'); |             alertBox = document.createElement('div'); | ||||||
|             alertBox.setAttribute('id', 'alertBox'); |             alertBox.setAttribute('id', 'alertBox'); | ||||||
|  |             alertBox.addEventListener('click', function() { | ||||||
|  |                 hideNotification(); | ||||||
|  |             }, false); | ||||||
|         } |         } | ||||||
|         else { |         else { | ||||||
|             alertBox = document.getElementById('alertBox'); |             alertBox = document.getElementById('alertBox'); | ||||||
| @@ -1400,15 +1403,20 @@ function showNotification(notificationTitle,notificationText,notificationHtml,no | |||||||
|         if (alertTimeout) |         if (alertTimeout) | ||||||
|             clearTimeout(alertTimeout); |             clearTimeout(alertTimeout); | ||||||
|         alertTimeout = setTimeout(function() { |         alertTimeout = setTimeout(function() { | ||||||
|             if (document.getElementById('alertBox')) |             hideNotification();     | ||||||
|                 document.getElementById('alertBox').classList.remove('alertBoxActive'); |  | ||||||
|             setTimeout(function() { |  | ||||||
|                 document.getElementById('alertBox').remove(); |  | ||||||
|             }, 600); |  | ||||||
|         }, 3000); |         }, 3000); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | function hideNotification() { | ||||||
|  |     if (document.getElementById('alertBox')) { | ||||||
|  |         document.getElementById('alertBox').classList.remove('alertBoxActive'); | ||||||
|  |         setTimeout(function() { | ||||||
|  |             document.getElementById('alertBox').remove(); | ||||||
|  |         }, 600); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  |  | ||||||
| function notificationsSupported() { | function notificationsSupported() { | ||||||
|     return "Notification" in window; |     return "Notification" in window; | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 jcorporation
					jcorporation