mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-20 04:18:19 -07:00
23677db990
This de-minifies and de-uglifies `controllers` subdirectory
32 lines
1.0 KiB
JavaScript
32 lines
1.0 KiB
JavaScript
define(["loading", "scripts/editorsidebar"], function (loading) {
|
|
"use strict";
|
|
|
|
function reload(context, itemId) {
|
|
loading.show();
|
|
|
|
if (itemId) {
|
|
require(["metadataEditor"], function (metadataEditor) {
|
|
metadataEditor.embed(context.querySelector(".editPageInnerContent"), itemId, ApiClient.serverInfo().Id);
|
|
});
|
|
} else {
|
|
context.querySelector(".editPageInnerContent").innerHTML = "";
|
|
loading.hide();
|
|
}
|
|
}
|
|
|
|
return function (view, params) {
|
|
view.addEventListener("viewshow", function () {
|
|
reload(this, MetadataEditor.getCurrentItemId());
|
|
});
|
|
MetadataEditor.setCurrentItemId(null);
|
|
view.querySelector(".libraryTree").addEventListener("itemclicked", function (event) {
|
|
var data = event.detail;
|
|
|
|
if (data.id != MetadataEditor.getCurrentItemId()) {
|
|
MetadataEditor.setCurrentItemId(data.id);
|
|
reload(view, data.id);
|
|
}
|
|
});
|
|
};
|
|
});
|