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

removal of self

This commit is contained in:
Cameron 2020-07-25 23:03:15 +01:00
parent f1b2a86c7d
commit a09ceeefa3

View file

@ -281,7 +281,7 @@ import 'emby-button';
mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange); mainTabsManager.setTabs(view, currentTabIndex, getTabs, getTabContainers, onBeforeTabChange, onTabChange);
} }
function getTabController(page, index, callback) { const getTabController = (page, index, callback) => {
let depends = ''; let depends = '';
switch (index) { switch (index) {
@ -319,7 +319,7 @@ import 'emby-button';
if (index === suggestionsTabIndex) { if (index === suggestionsTabIndex) {
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']"); tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
self.tabContent = tabContent; this.tabContent = tabContent;
} }
let controller = tabControllers[index]; let controller = tabControllers[index];
@ -328,7 +328,7 @@ import 'emby-button';
tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']"); tabContent = view.querySelector(".pageTabContent[data-index='" + index + "']");
if (index === suggestionsTabIndex) { if (index === suggestionsTabIndex) {
controller = self; controller = this;
} else if (index === 6) { } else if (index === 6) {
controller = new controllerFactory(view, tabContent, { controller = new controllerFactory(view, tabContent, {
collectionType: 'movies', collectionType: 'movies',
@ -351,7 +351,7 @@ import 'emby-button';
callback(controller); callback(controller);
}); });
} };
function preLoadTab(page, index) { function preLoadTab(page, index) {
getTabController(page, index, function (controller) { getTabController(page, index, function (controller) {
@ -363,12 +363,14 @@ import 'emby-button';
function loadTab(page, index) { function loadTab(page, index) {
currentTabIndex = index; currentTabIndex = index;
getTabController(page, index, function (controller) { getTabController(page, index, ((controller) => {
initialTabIndex = null;
if (renderedTabs.indexOf(index) == -1) { if (renderedTabs.indexOf(index) == -1) {
renderedTabs.push(index); renderedTabs.push(index);
controller.renderTab(); controller.renderTab();
} }
}); }));
} }
function onPlaybackStop(e, state) { function onPlaybackStop(e, state) {
@ -390,12 +392,12 @@ import 'emby-button';
var currentTabIndex = parseInt(params.tab || getDefaultTabIndex(params.topParentId)); var currentTabIndex = parseInt(params.tab || getDefaultTabIndex(params.topParentId));
var suggestionsTabIndex = 1; var suggestionsTabIndex = 1;
self.initTab = function () { this.initTab = function () {
let tabContent = view.querySelector(".pageTabContent[data-index='" + suggestionsTabIndex + "']"); let tabContent = view.querySelector(".pageTabContent[data-index='" + suggestionsTabIndex + "']");
initSuggestedTab(view, tabContent); initSuggestedTab(view, tabContent);
}; };
self.renderTab = function () { this.renderTab = function () {
let tabContent = view.querySelector(".pageTabContent[data-index='" + suggestionsTabIndex + "']"); let tabContent = view.querySelector(".pageTabContent[data-index='" + suggestionsTabIndex + "']");
loadSuggestionsTab(view, params, tabContent); loadSuggestionsTab(view, params, tabContent);
}; };