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

optimization imports from site.js

This commit is contained in:
vitorsemeano 2020-10-18 20:00:39 +01:00
parent a106e23ff8
commit 8b5772f996
11 changed files with 223 additions and 246 deletions

View file

@ -272,7 +272,7 @@ class AppRouter {
switch (result.State) {
case 'SignedIn':
loading.hide();
Emby.Page.goHome();
this.goHome();
break;
case 'ServerSignIn':
result.ApiClient.getPublicUsers().then((users) => {
@ -535,7 +535,7 @@ class AppRouter {
if (route.isDefaultRoute) {
console.debug('appRouter - loading skin home page');
Emby.Page.goHome();
this.goHome();
return;
} else if (route.roles) {
this.validateRoles(apiClient, route.roles).then(() => {
@ -836,3 +836,7 @@ class AppRouter {
}
export const appRouter = new AppRouter();
window.Emby = window.Emby || {};
window.Emby.Page = appRouter;

View file

@ -1,5 +1,6 @@
import { Events } from 'jellyfin-apiclient';
import globalize from '../scripts/globalize';
/* eslint-disable indent */
// TODO: replace with each plugin version

View file

@ -17,6 +17,7 @@ import './remotecontrol.css';
import '../../elements/emby-ratingbutton/emby-ratingbutton';
import ServerConnections from '../ServerConnections';
import toast from '../toast/toast';
import { appRouter } from "../appRouter";
/*eslint prefer-const: "error"*/
@ -599,7 +600,7 @@ export default function () {
if (!state.NextMediaType) {
updatePlayerState(player, dlg, {});
Emby.Page.back();
appRouter.back();
}
}

View file

@ -2,6 +2,7 @@ import backdrop from '../backdrop/backdrop';
import * as mainTabsManager from '../maintabsmanager';
import layoutManager from '../layoutManager';
import '../../elements/emby-tabs/emby-tabs';
import { appRouter } from '../appRouter';
function onViewDestroy(e) {
const tabControllers = this.tabControllers;
@ -109,7 +110,7 @@ class TabbedView {
}
}
setTitle() {
Emby.Page.setTitle('');
appRouter.setTitle('');
}
}