mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
cleanup data-require from viewContainer
This commit is contained in:
parent
6502446f88
commit
ce51c8012d
1 changed files with 57 additions and 70 deletions
|
@ -41,33 +41,21 @@ define(["browser", "dom", "layoutManager", "css!components/viewManager/viewConta
|
|||
var isPluginpage = -1 !== options.url.toLowerCase().indexOf("/configurationpage");
|
||||
var newViewInfo = normalizeNewView(options, isPluginpage);
|
||||
var newView = newViewInfo.elem;
|
||||
var dependencies = "string" == typeof newView ? null : newView.getAttribute("data-require");
|
||||
dependencies = dependencies ? dependencies.split(",") : [];
|
||||
|
||||
|
||||
if (isPluginpage) {
|
||||
dependencies.push("legacy/dashboard");
|
||||
require(["legacy/dashboard"]);
|
||||
}
|
||||
|
||||
if (newViewInfo.hasjQuerySelect) {
|
||||
dependencies.push("legacy/selectmenu");
|
||||
require(["legacy/selectmenu"]);
|
||||
}
|
||||
|
||||
if (newViewInfo.hasjQueryChecked) {
|
||||
dependencies.push("fnchecked");
|
||||
require(["fnchecked"]);
|
||||
}
|
||||
|
||||
if (newViewInfo.hasjQuery) {
|
||||
dependencies.push("jQuery");
|
||||
}
|
||||
|
||||
if (isPluginpage || newView.classList && newView.classList.contains("type-interior")) {
|
||||
dependencies.push("dashboardcss");
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
dependencies.join(",");
|
||||
|
||||
require(dependencies, function () {
|
||||
return new Promise(function (resolve) {
|
||||
var currentPage = allPages[pageIndex];
|
||||
|
||||
if (currentPage) {
|
||||
|
@ -134,7 +122,6 @@ define(["browser", "dom", "layoutManager", "css!components/viewManager/viewConta
|
|||
resolve(view);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue