diff --git a/EMS/admin-ui-bundle/assets/js/core/components/mediaLibrary.js b/EMS/admin-ui-bundle/assets/js/core/components/mediaLibrary.js index fe2f895dc..59798ffd3 100644 --- a/EMS/admin-ui-bundle/assets/js/core/components/mediaLibrary.js +++ b/EMS/admin-ui-bundle/assets/js/core/components/mediaLibrary.js @@ -189,7 +189,7 @@ export default class MediaLibrary { resolve() mediaLib.#elements.listUploads.removeChild(liUpload) } else { - reject() + reject(new Error('Unexpected status ' + request.status + ', 201 was expected')) progressBar.status('Error: ' + request.statusText) progressBar.progress(100) progressBar.style('danger') diff --git a/EMS/admin-ui-bundle/assets/js/core/events/addedDomEvent.js b/EMS/admin-ui-bundle/assets/js/core/events/addedDomEvent.js index d653f16d0..c008b1066 100644 --- a/EMS/admin-ui-bundle/assets/js/core/events/addedDomEvent.js +++ b/EMS/admin-ui-bundle/assets/js/core/events/addedDomEvent.js @@ -2,6 +2,9 @@ export class AddedDomEvent { constructor (target) { this._event = new CustomEvent('emsAddedDomEvent', { target }) this._target = target + } + + dispatch () { document.dispatchEvent(this._event) } } diff --git a/EMS/admin-ui-bundle/assets/js/core/helpers/ajaxModal.js b/EMS/admin-ui-bundle/assets/js/core/helpers/ajaxModal.js index 831a515f5..27182e254 100644 --- a/EMS/admin-ui-bundle/assets/js/core/helpers/ajaxModal.js +++ b/EMS/admin-ui-bundle/assets/js/core/helpers/ajaxModal.js @@ -148,7 +148,8 @@ class AjaxModal { this.$modal.find(':input').each(function () { $(this).addClass('ignore-ems-update') }) - new AddedDomEvent(this.modal) + const event = new AddedDomEvent(this.modal) + event.dispatch() } if (Object.prototype.hasOwnProperty.call(json, 'modalFooter')) { this.$modal.find('.ajax-modal-footer').html(json.modalFooter) diff --git a/EMS/admin-ui-bundle/assets/js/core/librairies/nestedSortable.js b/EMS/admin-ui-bundle/assets/js/core/librairies/nestedSortable.js index ee16b0050..b4f2d6246 100644 --- a/EMS/admin-ui-bundle/assets/js/core/librairies/nestedSortable.js +++ b/EMS/admin-ui-bundle/assets/js/core/librairies/nestedSortable.js @@ -10,6 +10,7 @@ * Licensed under the MIT License * http://www.opensource.org/licenses/mit-license.php */ +/* eslint-disable */ (function (factory) { 'use strict' diff --git a/EMS/admin-ui-bundle/assets/js/core/librairies/sortable.js b/EMS/admin-ui-bundle/assets/js/core/librairies/sortable.js index e0f5e0c5b..97bd01c8a 100644 --- a/EMS/admin-ui-bundle/assets/js/core/librairies/sortable.js +++ b/EMS/admin-ui-bundle/assets/js/core/librairies/sortable.js @@ -19,6 +19,8 @@ // >>demos: http://jqueryui.com/sortable/ // >>css.structure: ../../themes/base/sortable.css +/* eslint-disable */ + (function (factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module.