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

Merge pull request #1367 from jellyfin/controller

Add support for es6 controllers and migrate logs controller
This commit is contained in:
dkanada 2020-06-10 14:00:33 +09:00 committed by GitHub
commit 29ef245c8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 9 deletions

View file

@ -115,8 +115,9 @@
"src/components/syncPlay/playbackPermissionManager.js",
"src/components/syncPlay/syncPlayManager.js",
"src/components/syncPlay/timeSyncManager.js",
"src/controllers/dashboard/logs.js",
"src/plugins/bookPlayer/plugin.js",
"src/plugins/bookPlayer/tableOfContent.js",
"src/plugins/bookPlayer/tableOfContents.js",
"src/plugins/photoPlayer/plugin.js",
"src/scripts/deleteHelper.js",
"src/scripts/dfnshelper.js",

View file

@ -21,10 +21,11 @@ define(['viewContainer', 'focusManager', 'queryString', 'layoutManager'], functi
if (!newView.initComplete) {
newView.initComplete = true;
var controller;
if (typeof options.controllerFactory === 'function') {
// Use controller method
var controller = new options.controllerFactory(newView, eventDetail.detail.params);
controller = new options.controllerFactory(newView, eventDetail.detail.params);
} else if (options.controllerFactory && typeof options.controllerFactory.default === 'function') {
controller = new options.controllerFactory.default(newView, eventDetail.detail.params);
}
if (!options.controllerFactory || dispatchPageEvents) {

View file

@ -1,6 +1,12 @@
define(['datetime', 'loading', 'apphost', 'listViewStyle', 'emby-button', 'flexStyles'], function(datetime, loading, appHost) {
'use strict';
return function(view, params) {
import datetime from 'datetime';
import loading from 'loading';
import 'emby-button';
import 'listViewStyle';
import 'flexStyles';
/* eslint-disable indent */
export default function(view, params) {
view.addEventListener('viewbeforeshow', function() {
loading.show();
var apiClient = ApiClient;
@ -29,5 +35,6 @@ define(['datetime', 'loading', 'apphost', 'listViewStyle', 'emby-button', 'flexS
loading.hide();
});
});
};
});
}
/* eslint-enable indent */