File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/js/ui/notification-manager/src/providers/desktop.js
Back
import BaseProvider from './base'; import DesktopHelper from '../helpers/desktop'; import Notification from '../notification/notification'; import PushNotification from '../notification/push-notification'; import type { ProviderOptions } from './provider-options'; export default class DesktopProvider extends BaseProvider { constructor(options: ?ProviderOptions = {}) { super(options); if (this.getEventNamespace()) { this.registerEvents(); } } convertNotificationToNative(notification: Notification): string { throw new Error('convertNotificationToNative() method must be implemented.'); } canSendNotification(notification: Notification): boolean { //Desktop push & pull notifications, unlike regular ones, can be sent from only one tab to avoid duplication. return DesktopHelper.isMainTab() || !(notification instanceof PushNotification); } sendNotification(notificationUid: string): void { BXDesktopSystem.NotificationShow(notificationUid); } registerEvents(): void { window.addEventListener('BXNotificationClick', (event) => this.onNotificationClick(event)); window.addEventListener('BXNotificationAction', (event) => this.onNotificationAction(event)); window.addEventListener('BXNotificationDismissed', (event) => this.onNotificationClose(event)); } onNotificationClick(event): void { const [id] = event.detail; this.notificationClick(id); } onNotificationAction(event): void { const [id, action, userInput] = event.detail; this.notificationAction(id, action, userInput); } onNotificationClose(event): void { const [id, reason] = event.detail; this.notificationClose(id, reason); } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.27 |
proxy
|
phpinfo
|
Settings