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

@ -158,6 +158,7 @@
"src/components/syncPlay/playbackPermissionManager.js",
"src/components/syncPlay/syncPlayManager.js",
"src/components/syncPlay/timeSyncManager.js",
"src/components/tabbedview/tabbedview.js",
"src/controllers/session/addServer/index.js",
"src/controllers/session/forgotPassword/index.js",
"src/controllers/session/redeemPassword/index.js",

View file

@ -1,7 +1,9 @@
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) {
function onViewDestroy(e) {
var tabControllers = this.tabControllers;
if (tabControllers) {
@ -18,13 +20,14 @@ define(['backdrop', 'mainTabsManager', 'layoutManager', 'emby-tabs'], function (
this.params = null;
this.currentTabController = null;
this.initialTabIndex = null;
}
}
function onBeforeTabChange() {
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;