mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-01 01:36:00 -04:00
Fixed some image manager behaviour
fixed: - Double click not working after tab usage. - Synced edit form with select button.
This commit is contained in:
parent
8213ea9a71
commit
a46b248cf4
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user