Migration of edititemmetadata to ES6 module

This commit is contained in:
Cameron 2020-07-26 11:29:02 +01:00
parent feaabb6de9
commit 287cc06963
2 changed files with 26 additions and 26 deletions

View File

@ -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",

View File

@ -1,11 +1,11 @@
define(['loading', 'scripts/editorsidebar'], function (loading) {
'use strict';
import loading from 'loading';
import 'scripts/editorsidebar';
function reload(context, itemId) {
loading.show();
if (itemId) {
require(['metadataEditor'], function ({default: metadataEditor}) {
import('metadataEditor').then(({ default: metadataEditor }) => {
metadataEditor.embed(context.querySelector('.editPageInnerContent'), itemId, ApiClient.serverInfo().Id);
});
} else {
@ -14,7 +14,7 @@ define(['loading', 'scripts/editorsidebar'], function (loading) {
}
}
return function (view, params) {
export default function (view, params) {
view.addEventListener('viewshow', function () {
reload(this, MetadataEditor.getCurrentItemId());
});
@ -27,5 +27,4 @@ define(['loading', 'scripts/editorsidebar'], function (loading) {
reload(view, data.id);
}
});
};
});
}