aboutsummaryrefslogtreecommitdiffstats
path: root/javascript/notification.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/notification.js')
-rw-r--r--javascript/notification.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/javascript/notification.js b/javascript/notification.js
index 5ae6df24..a68a76f2 100644
--- a/javascript/notification.js
+++ b/javascript/notification.js
@@ -2,20 +2,20 @@
let lastHeadImg = null;
-notificationButton = null
+let notificationButton = null;
-onUiUpdate(function(){
- if(notificationButton == null){
- notificationButton = gradioApp().getElementById('request_notifications')
+onUiUpdate(function() {
+ if (notificationButton == null) {
+ notificationButton = gradioApp().getElementById('request_notifications');
- if(notificationButton != null){
- notificationButton.addEventListener('click', function (evt) {
- Notification.requestPermission();
- },true);
+ if (notificationButton != null) {
+ notificationButton.addEventListener('click', () => {
+ void Notification.requestPermission();
+ }, true);
}
}
- const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"][style*="display: block"] div[id$="_results"] img.h-full.w-full.overflow-hidden');
+ const galleryPreviews = gradioApp().querySelectorAll('div[id^="tab_"][style*="display: block"] div[id$="_results"] .thumbnail-item > img');
if (galleryPreviews == null) return;
@@ -42,7 +42,7 @@ onUiUpdate(function(){
}
);
- notification.onclick = function(_){
+ notification.onclick = function(_) {
parent.focus();
this.close();
};