mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Remove MetadataEditor global
This commit is contained in:
parent
8cc88fb08c
commit
9c6ea4b525
3 changed files with 11 additions and 21 deletions
|
@ -287,11 +287,12 @@ function updateEditorNode(page, item) {
|
|||
}
|
||||
}
|
||||
|
||||
function setCurrentItemId(id) {
|
||||
let itemId;
|
||||
export function setCurrentItemId(id) {
|
||||
itemId = id;
|
||||
}
|
||||
|
||||
function getCurrentItemId() {
|
||||
export function getCurrentItemId() {
|
||||
if (itemId) {
|
||||
return itemId;
|
||||
}
|
||||
|
@ -326,16 +327,4 @@ $(document).on('itemsaved', '.metadataEditorPage', function (e, item) {
|
|||
.off('open_node.jstree', onNodeOpen)
|
||||
.off('load_node.jstree', onNodeOpen);
|
||||
});
|
||||
let itemId;
|
||||
window.MetadataEditor = {
|
||||
getItemPromise: function () {
|
||||
const currentItemId = getCurrentItemId();
|
||||
if (currentItemId) {
|
||||
return ApiClient.getItem(Dashboard.getCurrentUserId(), currentItemId);
|
||||
}
|
||||
return ApiClient.getRootFolder(Dashboard.getCurrentUserId());
|
||||
},
|
||||
getCurrentItemId: getCurrentItemId,
|
||||
setCurrentItemId: setCurrentItemId
|
||||
};
|
||||
/* eslint-enable @typescript-eslint/naming-convention */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue