mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove require
This reverts commit bef8a4509d0b151e7a2e85f549bfca49ce952341.
This commit is contained in:
parent
f4b1a1a6fe
commit
997054ab12
1 changed files with 4 additions and 11 deletions
|
@ -1,6 +1,5 @@
|
||||||
import TabbedView from 'tabbedView';
|
import TabbedView from 'tabbedView';
|
||||||
import globalize from 'globalize';
|
import globalize from 'globalize';
|
||||||
import require from 'require';
|
|
||||||
import 'emby-tabs';
|
import 'emby-tabs';
|
||||||
import 'emby-button';
|
import 'emby-button';
|
||||||
import 'emby-scroller';
|
import 'emby-scroller';
|
||||||
|
@ -17,30 +16,24 @@ function getDefaultTabIndex() {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRequirePromise(deps) {
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
require(deps, resolve);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTabController(index) {
|
function getTabController(index) {
|
||||||
if (null == index) {
|
if (null == index) {
|
||||||
throw new Error('index cannot be null');
|
throw new Error('index cannot be null');
|
||||||
}
|
}
|
||||||
|
|
||||||
const depends = [];
|
let depends = '';
|
||||||
|
|
||||||
switch (index) {
|
switch (index) {
|
||||||
case 0:
|
case 0:
|
||||||
depends.push('controllers/hometab');
|
depends = 'controllers/hometab';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
depends.push('controllers/favorites');
|
depends = 'controllers/favorites';
|
||||||
}
|
}
|
||||||
|
|
||||||
const instance = this;
|
const instance = this;
|
||||||
return getRequirePromise(depends).then(function (controllerFactory) {
|
return import(depends).then(({ default: controllerFactory }) => {
|
||||||
let controller = instance.tabControllers[index];
|
let controller = instance.tabControllers[index];
|
||||||
|
|
||||||
if (!controller) {
|
if (!controller) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue