Fixed some image manager behaviour

fixed:
- Double click not working after tab usage.
- Synced edit form with select button.
This commit is contained in:
Dan Brown 2020-07-25 11:47:12 +01:00
parent 8213ea9a71
commit a46b248cf4
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -27,8 +27,8 @@ class ImageManager {
this.type = 'gallery';
this.lastSelected = {};
this.lastSelectedTime = 0;
this.callback = null;
this.resetState = () => {
this.callback = null;
this.hasData = false;
this.page = 1;
this.filter = 'all';
@ -143,14 +143,19 @@ class ImageManager {
this.resetState();
this.resetListView();
this.resetSearchView();
this.formContainer.innerHTML = '';
this.resetEditForm();
this.setActiveFilterTab('all');
this.selectButton.classList.add('hidden');
}
resetSearchView() {
this.searchInput.value = '';
}
resetEditForm() {
this.formContainer.innerHTML = '';
}
resetListView() {
showLoading(this.listContainer);
this.page = 1;
@ -173,6 +178,8 @@ class ImageManager {
if (!alreadySelected) {
event.target.classList.add('selected');
this.loadImageEditForm(image.id);
} else {
this.resetEditForm();
}
this.selectButton.classList.toggle('hidden', alreadySelected);