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:
parent
bbf1f8d5df
commit
97e80101d0
1 changed files with 58 additions and 55 deletions
|
@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue