mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-15 18:08:17 -07:00
Migration of edititemmetadata to ES6 module
This commit is contained in:
parent
feaabb6de9
commit
287cc06963
@ -189,6 +189,7 @@
|
||||
"src/controllers/dashboard/users/userparentalcontrol.js",
|
||||
"src/controllers/dashboard/users/userpasswordpage.js",
|
||||
"src/controllers/dashboard/users/userprofilespage.js",
|
||||
"src/controllers/edititemmetadata.js",
|
||||
"src/controllers/playback/nowplaying.js",
|
||||
"src/controllers/playback/videoosd.js",
|
||||
"src/controllers/searchpage.js",
|
||||
|
@ -1,31 +1,30 @@
|
||||
define(['loading', 'scripts/editorsidebar'], function (loading) {
|
||||
'use strict';
|
||||
import loading from 'loading';
|
||||
import 'scripts/editorsidebar';
|
||||
|
||||
function reload(context, itemId) {
|
||||
loading.show();
|
||||
function reload(context, itemId) {
|
||||
loading.show();
|
||||
|
||||
if (itemId) {
|
||||
require(['metadataEditor'], function ({default: metadataEditor}) {
|
||||
metadataEditor.embed(context.querySelector('.editPageInnerContent'), itemId, ApiClient.serverInfo().Id);
|
||||
});
|
||||
} else {
|
||||
context.querySelector('.editPageInnerContent').innerHTML = '';
|
||||
loading.hide();
|
||||
}
|
||||
if (itemId) {
|
||||
import('metadataEditor').then(({ default: 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;
|
||||
export default 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);
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
if (data.id != MetadataEditor.getCurrentItemId()) {
|
||||
MetadataEditor.setCurrentItemId(data.id);
|
||||
reload(view, data.id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user