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

Migration of tabbedview to ES6 module

This commit is contained in:
Cameron 2020-07-31 16:12:49 +01:00
parent 997054ab12
commit 39627f364a
2 changed files with 32 additions and 29 deletions

View file

@ -1,30 +1,33 @@
define(['backdrop', 'mainTabsManager', 'layoutManager', 'emby-tabs'], function (backdrop, mainTabsManager, layoutManager) {
'use strict';
import backdrop from 'backdrop';
import * as mainTabsManager from 'mainTabsManager';
import layoutManager from 'layoutManager';
import 'emby-tabs';
function onViewDestroy(e) {
var tabControllers = this.tabControllers;
function onViewDestroy(e) {
var tabControllers = this.tabControllers;
if (tabControllers) {
tabControllers.forEach(function (t) {
if (t.destroy) {
t.destroy();
}
});
if (tabControllers) {
tabControllers.forEach(function (t) {
if (t.destroy) {
t.destroy();
}
});
this.tabControllers = null;
}
this.view = null;
this.params = null;
this.currentTabController = null;
this.initialTabIndex = null;
this.tabControllers = null;
}
function onBeforeTabChange() {
this.view = null;
this.params = null;
this.currentTabController = null;
this.initialTabIndex = null;
}
}
function onBeforeTabChange() {
function TabbedView(view, params) {
}
class TabbedView {
constructor(view, params) {
this.tabControllers = [];
this.view = view;
this.params = params;
@ -85,7 +88,7 @@ define(['backdrop', 'mainTabsManager', 'layoutManager', 'emby-tabs'], function (
view.addEventListener('viewdestroy', onViewDestroy.bind(this));
}
TabbedView.prototype.onResume = function (options) {
onResume(options) {
this.setTitle();
backdrop.clearBackdrop();
@ -96,19 +99,18 @@ define(['backdrop', 'mainTabsManager', 'layoutManager', 'emby-tabs'], function (
} else if (currentTabController && currentTabController.onResume) {
currentTabController.onResume({});
}
};
}
TabbedView.prototype.onPause = function () {
onPause() {
var currentTabController = this.currentTabController;
if (currentTabController && currentTabController.onPause) {
currentTabController.onPause();
}
};
TabbedView.prototype.setTitle = function () {
}
setTitle() {
Emby.Page.setTitle('');
};
}
}
return TabbedView;
});
export default TabbedView;