Differential D18457 Diff 44343 webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js
Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/aphlict/behavior-desktop-notifications-control.js
| Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | JX.DOM.listen( | ||||
| select, | select, | ||||
| 'change', | 'change', | ||||
| null, | null, | ||||
| function (e) { | function (e) { | ||||
| if (!JX.Notification.supportsDesktopNotifications()) { | if (!JX.Notification.supportsDesktopNotifications()) { | ||||
| return; | return; | ||||
| } | } | ||||
| var value = e.getTarget().value; | var value = e.getTarget().value; | ||||
| if (value == config.desktopMode) { | if ((value == config.desktop) || (value == config.desktopOnly)) { | ||||
| window.Notification.requestPermission( | window.Notification.requestPermission( | ||||
| function (permission) { | function (permission) { | ||||
| updateFormStatus(permission); | updateFormStatus(permission); | ||||
| updateBrowserStatus(permission); | updateBrowserStatus(permission); | ||||
| }); | }); | ||||
| } else { | } else { | ||||
| var statusEl = JX.$(config.statusID); | var statusEl = JX.$(config.statusID); | ||||
| JX.DOM.hide(statusEl); | JX.DOM.hide(statusEl); | ||||
| } | } | ||||
| }); | }); | ||||
| } | } | ||||
| function install() { | function install() { | ||||
| Show All 24 Lines | |||||