Remove setTitle function in app router

This commit is contained in:
Bill Thornton 2022-03-31 14:36:09 -04:00
parent 3a14418e47
commit 1085034c18
7 changed files with 14 additions and 15 deletions

View File

@ -715,10 +715,6 @@ class AppRouter {
Dashboard.navigate('home.html?tab=1'); Dashboard.navigate('home.html?tab=1');
} }
setTitle(title) {
LibraryMenu.setTitle(title);
}
getRouteUrl(item, options) { getRouteUrl(item, options) {
if (!item) { if (!item) {
throw new Error('item cannot be null'); throw new Error('item cannot be null');

View File

@ -2,7 +2,7 @@ import backdrop from '../backdrop/backdrop';
import * as mainTabsManager from '../maintabsmanager'; import * as mainTabsManager from '../maintabsmanager';
import layoutManager from '../layoutManager'; import layoutManager from '../layoutManager';
import '../../elements/emby-tabs/emby-tabs'; import '../../elements/emby-tabs/emby-tabs';
import { appRouter } from '../appRouter'; import LibraryMenu from '../../scripts/libraryMenu';
function onViewDestroy() { function onViewDestroy() {
const tabControllers = this.tabControllers; const tabControllers = this.tabControllers;
@ -105,8 +105,9 @@ class TabbedView {
currentTabController.onPause(); currentTabController.onPause();
} }
} }
setTitle() { setTitle() {
appRouter.setTitle(''); LibraryMenu.setTitle('');
} }
} }

View File

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

View File

@ -33,6 +33,7 @@ import Dashboard from '../../scripts/clientUtils';
import ServerConnections from '../../components/ServerConnections'; import ServerConnections from '../../components/ServerConnections';
import confirm from '../../components/confirm/confirm'; import confirm from '../../components/confirm/confirm';
import { download } from '../../scripts/fileDownloader'; import { download } from '../../scripts/fileDownloader';
import LibraryMenu from '../../scripts/libraryMenu';
function autoFocus(container) { function autoFocus(container) {
import('../../components/autoFocuser').then(({ default: autoFocuser }) => { import('../../components/autoFocuser').then(({ default: autoFocuser }) => {
@ -571,7 +572,7 @@ function renderDetailPageBackdrop(page, item, apiClient) {
function reloadFromItem(instance, page, params, item, user) { function reloadFromItem(instance, page, params, item, user) {
const apiClient = ServerConnections.getApiClient(item.ServerId); const apiClient = ServerConnections.getApiClient(item.ServerId);
appRouter.setTitle(''); LibraryMenu.setTitle('');
// Start rendering the artwork first // Start rendering the artwork first
renderImage(page, item); renderImage(page, item);
@ -2042,7 +2043,7 @@ export default function (view, params) {
if (e.detail.isRestored) { if (e.detail.isRestored) {
if (currentItem) { if (currentItem) {
appRouter.setTitle(''); LibraryMenu.setTitle('');
renderTrackSelections(page, self, currentItem, true); renderTrackSelections(page, self, currentItem, true);
renderBackdrop(currentItem); renderBackdrop(currentItem);
} }

View File

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

View File

@ -23,6 +23,7 @@ import ServerConnections from '../../../components/ServerConnections';
import shell from '../../../scripts/shell'; import shell from '../../../scripts/shell';
import SubtitleSync from '../../../components/subtitlesync/subtitlesync'; import SubtitleSync from '../../../components/subtitlesync/subtitlesync';
import { appRouter } from '../../../components/appRouter'; import { appRouter } from '../../../components/appRouter';
import LibraryMenu from '../../../scripts/libraryMenu';
/* eslint-disable indent */ /* eslint-disable indent */
@ -150,7 +151,7 @@ import { appRouter } from '../../../components/appRouter';
currentItem = item; currentItem = item;
if (!item) { if (!item) {
updateRecordingButton(null); updateRecordingButton(null);
appRouter.setTitle(''); LibraryMenu.setTitle('');
nowPlayingVolumeSlider.disabled = true; nowPlayingVolumeSlider.disabled = true;
nowPlayingPositionSlider.disabled = true; nowPlayingPositionSlider.disabled = true;
btnFastForward.disabled = true; btnFastForward.disabled = true;
@ -206,7 +207,7 @@ import { appRouter } from '../../../components/appRouter';
itemName = parentName || ''; itemName = parentName || '';
} }
appRouter.setTitle(itemName); LibraryMenu.setTitle(itemName);
const documentTitle = parentName || (item ? item.Name : null); const documentTitle = parentName || (item ? item.Name : null);

View File

@ -196,7 +196,7 @@ import cardBuilder from '../../../components/cardbuilder/cardBuilder';
updatePageStyle(view, params); updatePageStyle(view, params);
view.addEventListener('viewshow', function (e) { view.addEventListener('viewshow', function (e) {
const isRestored = e.detail.isRestored; const isRestored = e.detail.isRestored;
appRouter.setTitle(null); libraryMenu.setTitle(null);
libraryMenu.setTransparentMenu(true); libraryMenu.setTransparentMenu(true);
if (!isRestored) { if (!isRestored) {