1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fix apiclient imports

This commit is contained in:
Bill Thornton 2020-09-08 02:05:02 -04:00 committed by vitorsemeano
parent 7d9208e951
commit a71b0314d4
71 changed files with 424 additions and 425 deletions

View file

@ -1,21 +1,21 @@
import EmbyProgressRing from '../emby-progressring/emby-progressring';
import dom from '../../scripts/dom';
import serverNotifications from '../../scripts/serverNotifications';
import { events } from 'jellyfin-apiclient';
import { Events } from 'jellyfin-apiclient';
import 'webcomponents.js';
/* eslint-disable indent */
function addNotificationEvent(instance, name, handler) {
const localHandler = handler.bind(instance);
events.on(serverNotifications, name, localHandler);
Events.on(serverNotifications, name, localHandler);
instance[name] = localHandler;
}
function removeNotificationEvent(instance, name) {
const handler = instance[name];
if (handler) {
events.off(serverNotifications, name, handler);
Events.off(serverNotifications, name, handler);
instance[name] = null;
}
}

View file

@ -9,7 +9,7 @@ import dom from '../../scripts/dom';
import loading from '../../components/loading/loading';
import focusManager from '../../components/focusManager';
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, events } from 'jellyfin-apiclient';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import 'webcomponents.js';
/* eslint-disable indent */
@ -271,7 +271,7 @@ import 'webcomponents.js';
function addNotificationEvent(instance, name, handler, owner) {
const localHandler = handler.bind(instance);
owner = owner || serverNotifications;
events.on(owner, name, localHandler);
Events.on(owner, name, localHandler);
instance['event_' + name] = localHandler;
}
@ -279,7 +279,7 @@ import 'webcomponents.js';
const handler = instance['event_' + name];
if (handler) {
owner = owner || serverNotifications;
events.off(owner, name, handler);
Events.off(owner, name, handler);
instance['event_' + name] = null;
}
}

View file

@ -1,5 +1,5 @@
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, events } from 'jellyfin-apiclient';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize';
import EmbyButtonPrototype from '../../elements/emby-button/emby-button';
@ -7,14 +7,14 @@ import EmbyButtonPrototype from '../../elements/emby-button/emby-button';
function addNotificationEvent(instance, name, handler) {
const localHandler = handler.bind(instance);
events.on(serverNotifications, name, localHandler);
Events.on(serverNotifications, name, localHandler);
instance[name] = localHandler;
}
function removeNotificationEvent(instance, name) {
const handler = instance[name];
if (handler) {
events.off(serverNotifications, name, handler);
Events.off(serverNotifications, name, handler);
instance[name] = null;
}
}

View file

@ -1,5 +1,5 @@
import serverNotifications from '../../scripts/serverNotifications';
import { ConnectionManager, events } from 'jellyfin-apiclient';
import { ConnectionManager, Events } from 'jellyfin-apiclient';
import globalize from '../../scripts/globalize';
import EmbyButtonPrototype from '../emby-button/emby-button';
@ -7,14 +7,14 @@ import EmbyButtonPrototype from '../emby-button/emby-button';
function addNotificationEvent(instance, name, handler) {
const localHandler = handler.bind(instance);
events.on(serverNotifications, name, localHandler);
Events.on(serverNotifications, name, localHandler);
instance[name] = localHandler;
}
function removeNotificationEvent(instance, name) {
const handler = instance[name];
if (handler) {
events.off(serverNotifications, name, handler);
Events.off(serverNotifications, name, handler);
instance[name] = null;
}
}