import {onChildEvent, onSelect, removeLoading, showLoading} from "../services/dom";
+import {Component} from "./component";
-/**
- * ImageManager
- * @extends {Component}
- */
-class ImageManager {
+export class ImageManager extends Component {
setup() {
-
// Options
this.uploadedTo = this.$opts.uploadedTo;
this.resetState();
this.setupListeners();
-
- window.ImageManager = this;
}
setupListeners() {
this.callback = callback;
this.type = type;
- this.popupEl.components.popup.show();
+ this.getPopup().show();
this.dropzoneContainer.classList.toggle('hidden', type !== 'gallery');
if (!this.hasData) {
}
hide() {
- this.popupEl.components.popup.hide();
+ this.getPopup().hide();
+ }
+
+ /**
+ * @returns {Popup}
+ */
+ getPopup() {
+ return window.$components.firstOnElement(this.popupEl, 'popup');
}
async loadGallery() {
window.$components.init(this.formContainer);
}
-}
-
-export default ImageManager;
\ No newline at end of file
+}
\ No newline at end of file