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

@ -3,6 +3,7 @@ import globalize from '../scripts/globalize';
import '../elements/emby-tabs/emby-tabs';
import '../elements/emby-button/emby-button';
import '../elements/emby-scroller/emby-scroller';
import { appRouter } from '../components/appRouter';
class HomeView extends TabbedView {
constructor(view, params) {
@ -10,7 +11,7 @@ class HomeView extends TabbedView {
}
setTitle() {
Emby.Page.setTitle(null);
appRouter.setTitle(null);
}
onPause() {

View file

@ -568,7 +568,7 @@ function renderDetailPageBackdrop(page, item, apiClient) {
function reloadFromItem(instance, page, params, item, user) {
const apiClient = ServerConnections.getApiClient(item.ServerId);
Emby.Page.setTitle('');
appRouter.setTitle('');
// Start rendering the artwork first
renderImage(page, item);
@ -2046,7 +2046,7 @@ export default function (view, params) {
if (e.detail.isRestored) {
if (currentItem) {
Emby.Page.setTitle('');
appRouter.setTitle('');
renderTrackSelections(page, self, currentItem, true);
}
} else {

View file

@ -11,6 +11,7 @@ import AlphaPicker from '../components/alphaPicker/alphaPicker';
import '../elements/emby-itemscontainer/emby-itemscontainer';
import '../elements/emby-scroller/emby-scroller';
import ServerConnections from '../components/ServerConnections';
import { appRouter } from '../components/appRouter';
/* eslint-disable indent */
@ -573,7 +574,7 @@ class ItemsView {
}
function setTitle(item) {
Emby.Page.setTitle(getTitle(item) || '');
appRouter.setTitle(getTitle(item) || '');
if (item && item.CollectionType === 'playlists') {
hideOrShowAll(view.querySelectorAll('.btnNewItem'), false);

View file

@ -20,6 +20,7 @@ import '../../../assets/css/videoosd.css';
import ServerConnections from '../../../components/ServerConnections';
import shell from '../../../scripts/shell';
import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
import { appRouter } from '../../../components/appRouter';
/* eslint-disable indent */
@ -193,7 +194,7 @@ import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
currentItem = item;
if (!item) {
updateRecordingButton(null);
Emby.Page.setTitle('');
appRouter.setTitle('');
nowPlayingVolumeSlider.disabled = true;
nowPlayingPositionSlider.disabled = true;
btnFastForward.disabled = true;
@ -241,7 +242,7 @@ import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
itemName = parentName || '';
}
Emby.Page.setTitle(itemName);
appRouter.setTitle(itemName);
const documentTitle = parentName || (item ? item.Name : null);
@ -513,7 +514,7 @@ import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
if (state.NextMediaType !== 'Video') {
view.removeEventListener('viewbeforehide', onViewHideStopPlayback);
Emby.Page.back();
appRouter.back();
}
}
@ -1292,7 +1293,7 @@ import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
view.addEventListener('viewbeforeshow', function (e) {
headerElement.classList.add('osdHeader');
Emby.Page.setTransparency('full');
appRouter.setTransparency('full');
});
view.addEventListener('viewshow', function (e) {
try {