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

Load modules before loading view

This commit is contained in:
chrstnjrsch 2020-01-04 01:31:35 +01:00
parent bbf1f8d5df
commit 97e80101d0

View file

@ -41,20 +41,22 @@ define(["browser", "dom", "layoutManager", "css!components/viewManager/viewConta
var isPluginpage = -1 !== options.url.toLowerCase().indexOf("/configurationpage"); var isPluginpage = -1 !== options.url.toLowerCase().indexOf("/configurationpage");
var newViewInfo = normalizeNewView(options, isPluginpage); var newViewInfo = normalizeNewView(options, isPluginpage);
var newView = newViewInfo.elem; var newView = newViewInfo.elem;
var modulesToLoad = [];
if (isPluginpage) { if (isPluginpage) {
require(["legacyDashboard"]); modulesToLoad.push("legacyDashboard");
} }
if (newViewInfo.hasjQuerySelect) { if (newViewInfo.hasjQuerySelect) {
require(["legacySelectMenu"]); modulesToLoad.push("legacySelectMenu");
} }
if (newViewInfo.hasjQueryChecked) { if (newViewInfo.hasjQueryChecked) {
require(["fnchecked"]); modulesToLoad.push("fnchecked");
} }
return new Promise(function (resolve) { return new Promise(function (resolve) {
require(modulesToLoad, function () {
var currentPage = allPages[pageIndex]; var currentPage = allPages[pageIndex];
if (currentPage) { if (currentPage) {
@ -121,6 +123,7 @@ define(["browser", "dom", "layoutManager", "css!components/viewManager/viewConta
resolve(view); resolve(view);
}); });
}); });
});
} }
} }