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

update tv tabs

This commit is contained in:
Luke Pulverenti 2016-03-18 21:40:13 -04:00
parent 36d7dc70f3
commit 4e3f639990
3 changed files with 10 additions and 12 deletions

View file

@ -232,10 +232,7 @@
}); });
} }
self.initTab = function () { initPage(tabContent);
initPage(tabContent);
};
self.renderTab = function () { self.renderTab = function () {
if (LibraryBrowser.needsRefresh(tabContent)) { if (LibraryBrowser.needsRefresh(tabContent)) {

View file

@ -180,6 +180,7 @@
} }
}; };
var tabControllers = [];
function loadTab(page, index) { function loadTab(page, index) {
var tabContent = page.querySelector('.pageTabContent[data-index=\'' + index + '\']'); var tabContent = page.querySelector('.pageTabContent[data-index=\'' + index + '\']');
@ -216,11 +217,14 @@
if (index == 0) { if (index == 0) {
self.tabContent = tabContent; self.tabContent = tabContent;
} }
var controller = index ? new controllerFactory(view, params, tabContent) : self; var controller = tabControllers[index];
if (!controller) {
controller = index ? new controllerFactory(view, params, tabContent) : self;
tabControllers[index] = controller;
if (controller.initTab) { if (controller.initTab) {
controller.initTab(); controller.initTab();
tabContent.initComplete = true; }
} }
controller.renderTab(); controller.renderTab();

View file

@ -258,10 +258,7 @@
}); });
} }
self.initTab = function () { initPage(tabContent);
initPage(tabContent);
};
self.renderTab = function () { self.renderTab = function () {
if (LibraryBrowser.needsRefresh(tabContent)) { if (LibraryBrowser.needsRefresh(tabContent)) {