Dropzone: Developed ux further

- Added image manager button for uploads.
- Added image manager placeholder sidebar text for guidance.
- Improved dropzone layer styling.
- Removed old dropzone styles.
- Got success events and auto-hide working.
- Updated upload items to animate out.
This commit is contained in:
Dan Brown
2023-04-25 13:10:25 +01:00
parent a8fc29a31e
commit b21a9007c5
7 changed files with 103 additions and 338 deletions

View File

@ -19,6 +19,7 @@ export class ImageManager extends Component {
this.filterTabs = this.$manyRefs.filterTabs;
this.selectButton = this.$refs.selectButton;
this.formContainer = this.$refs.formContainer;
this.formContainerPlaceholder = this.$refs.formContainerPlaceholder;
this.dropzoneContainer = this.$refs.dropzoneContainer;
// Instance data
@ -92,8 +93,11 @@ export class ImageManager extends Component {
}
});
this.formContainer.addEventListener('ajax-form-success', this.refreshGallery.bind(this));
this.container.addEventListener('dropzone-success', this.refreshGallery.bind(this));
this.formContainer.addEventListener('ajax-form-success', () => {
this.refreshGallery();
this.resetEditForm();
});
this.container.addEventListener('dropzone-upload-success', this.refreshGallery.bind(this));
}
show(callback, type = 'gallery') {
@ -168,6 +172,7 @@ export class ImageManager extends Component {
resetEditForm() {
this.formContainer.innerHTML = '';
this.formContainerPlaceholder.removeAttribute('hidden');
}
resetListView() {
@ -214,6 +219,7 @@ export class ImageManager extends Component {
const params = requestDelete ? {delete: true} : {};
const {data: formHtml} = await window.$http.get(`/images/edit/${imageId}`, params);
this.formContainer.innerHTML = formHtml;
this.formContainerPlaceholder.setAttribute('hidden', '');
window.$components.init(this.formContainer);
}