apply suggestion

This commit is contained in:
grafixeyehero 2020-06-26 19:30:44 +03:00
parent c5e2bbf87f
commit daedd3a61d
3 changed files with 58 additions and 62 deletions

View file

@ -194,9 +194,8 @@ import 'flexStyles';
});
}
export class editor {
constructor() {
this.show = options => {
export class showEditor {
constructor(options) {
return new Promise((resolve) => {
currentOptions = options;
currentResolve = resolve;
@ -224,7 +223,6 @@ export class editor {
initLibraryOptions(dlg);
});
});
};
}
}
@ -235,4 +233,4 @@ export class editor {
let isCreating = false;
/* eslint-enable indent */
export default editor;
export default showEditor;

View file

@ -209,9 +209,8 @@ import 'flexStyles';
currentDeferred.resolveWith(null, [hasChanges]);
}
export class editor {
constructor() {
this.show = options => {
export class showEditor {
constructor(options) {
const deferred = jQuery.Deferred();
currentOptions = options;
currentDeferred = deferred;
@ -238,7 +237,6 @@ export class editor {
refreshLibraryFromServer(dlg);
});
return deferred.promise();
};
}
}
@ -248,4 +246,4 @@ export class editor {
let isCreating = false;
/* eslint-enable indent */
export default editor;
export default showEditor;

View file

@ -3,7 +3,7 @@ define(['jQuery', 'apphost', 'scripts/taskbutton', 'loading', 'libraryMenu', 'gl
function addVirtualFolder(page) {
require(['medialibrarycreator'], function (medialibrarycreator) {
new medialibrarycreator.default().show({
new medialibrarycreator.showEditor({
collectionTypeOptions: getCollectionTypeOptions().filter(function (f) {
return !f.hidden;
}),
@ -18,7 +18,7 @@ define(['jQuery', 'apphost', 'scripts/taskbutton', 'loading', 'libraryMenu', 'gl
function editVirtualFolder(page, virtualFolder) {
require(['medialibraryeditor'], function (medialibraryeditor) {
new medialibraryeditor.default().show({
new medialibraryeditor.showEditor({
refresh: shouldRefreshLibraryAfterChanges(page),
library: virtualFolder
}).then(function (hasChanges) {