diff options
Diffstat (limited to 'javascript/notification.js')
-rw-r--r-- | javascript/notification.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/javascript/notification.js b/javascript/notification.js index 4711c279..e8159a7e 100644 --- a/javascript/notification.js +++ b/javascript/notification.js @@ -2,7 +2,19 @@ let lastHeadImg = null; +notificationButton = null + onUiUpdate(function(){ + if(notificationButton == null){ + notificationButton = gradioApp().getElementById('request_notifications') + + if(notificationButton != null){ + notificationButton.addEventListener('click', function (evt) { + Notification.requestPermission(); + },true); + } + } + const galleryPreviews = gradioApp().querySelectorAll('img.h-full.w-full.overflow-hidden'); if (galleryPreviews == null) return; |