diff --git a/src/components/imageOptionsEditor/imageOptionsEditor.js b/src/components/imageOptionsEditor/imageOptionsEditor.js index 2a3022b0da..8177e1b779 100644 --- a/src/components/imageOptionsEditor/imageOptionsEditor.js +++ b/src/components/imageOptionsEditor/imageOptionsEditor.js @@ -89,31 +89,29 @@ import 'emby-input'; }); } -export class editor { - constructor() { - this.show = (itemType, options, availableOptions) => { - return import('text!./components/imageOptionsEditor/imageOptionsEditor.template.html').then(({default: template}) => { - return new Promise((resolve) => { - const dlg = dialogHelper.createDialog({ - size: 'small', - removeOnClose: true, - scrollY: false - }); - dlg.classList.add('formDialog'); - dlg.innerHTML = globalize.translateDocument(template); - dlg.addEventListener('close', () => { - saveValues(dlg, options); - }); - loadValues(dlg, itemType, options, availableOptions); - dialogHelper.open(dlg).then(resolve, resolve); - dlg.querySelector('.btnCancel').addEventListener('click', () => { - dialogHelper.close(dlg); - }); +export class showEditor { + constructor(itemType, options, availableOptions) { + return import('text!./components/imageOptionsEditor/imageOptionsEditor.template.html').then(({default: template}) => { + return new Promise((resolve) => { + const dlg = dialogHelper.createDialog({ + size: 'small', + removeOnClose: true, + scrollY: false + }); + dlg.classList.add('formDialog'); + dlg.innerHTML = globalize.translateDocument(template); + dlg.addEventListener('close', () => { + saveValues(dlg, options); + }); + loadValues(dlg, itemType, options, availableOptions); + dialogHelper.open(dlg).then(resolve, resolve); + dlg.querySelector('.btnCancel').addEventListener('click', () => { + dialogHelper.close(dlg); }); }); - }; + }); } } /* eslint-enable indent */ -export default editor; +export default showEditor; diff --git a/src/components/libraryoptionseditor/libraryoptionseditor.js b/src/components/libraryoptionseditor/libraryoptionseditor.js index 8b365e51ae..f7c1ff1361 100644 --- a/src/components/libraryoptionseditor/libraryoptionseditor.js +++ b/src/components/libraryoptionseditor/libraryoptionseditor.js @@ -306,7 +306,7 @@ import 'emby-input'; } function showImageOptionsForType(type) { - import('imageoptionseditor').then(({default: ImageOptionsEditor}) => { + import('imageoptionseditor').then(ImageOptionsEditor => { let typeOptions = getTypeOptions(currentLibraryOptions, type); if (!typeOptions) { typeOptions = { @@ -315,8 +315,7 @@ import 'emby-input'; currentLibraryOptions.TypeOptions.push(typeOptions); } const availableOptions = getTypeOptions(currentAvailableOptions || {}, type); - const imageOptionsEditor = new ImageOptionsEditor(); - imageOptionsEditor.show(type, typeOptions, availableOptions); + new ImageOptionsEditor.showEditor(type, typeOptions, availableOptions); }); }