mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-02-01 04:16:30 +08: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.type = 'gallery';
|
||||||
this.lastSelected = {};
|
this.lastSelected = {};
|
||||||
this.lastSelectedTime = 0;
|
this.lastSelectedTime = 0;
|
||||||
|
this.callback = null;
|
||||||
this.resetState = () => {
|
this.resetState = () => {
|
||||||
this.callback = null;
|
|
||||||
this.hasData = false;
|
this.hasData = false;
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
this.filter = 'all';
|
this.filter = 'all';
|
||||||
|
@ -143,14 +143,19 @@ class ImageManager {
|
||||||
this.resetState();
|
this.resetState();
|
||||||
this.resetListView();
|
this.resetListView();
|
||||||
this.resetSearchView();
|
this.resetSearchView();
|
||||||
this.formContainer.innerHTML = '';
|
this.resetEditForm();
|
||||||
this.setActiveFilterTab('all');
|
this.setActiveFilterTab('all');
|
||||||
|
this.selectButton.classList.add('hidden');
|
||||||
}
|
}
|
||||||
|
|
||||||
resetSearchView() {
|
resetSearchView() {
|
||||||
this.searchInput.value = '';
|
this.searchInput.value = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resetEditForm() {
|
||||||
|
this.formContainer.innerHTML = '';
|
||||||
|
}
|
||||||
|
|
||||||
resetListView() {
|
resetListView() {
|
||||||
showLoading(this.listContainer);
|
showLoading(this.listContainer);
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
|
@ -173,6 +178,8 @@ class ImageManager {
|
||||||
if (!alreadySelected) {
|
if (!alreadySelected) {
|
||||||
event.target.classList.add('selected');
|
event.target.classList.add('selected');
|
||||||
this.loadImageEditForm(image.id);
|
this.loadImageEditForm(image.id);
|
||||||
|
} else {
|
||||||
|
this.resetEditForm();
|
||||||
}
|
}
|
||||||
this.selectButton.classList.toggle('hidden', alreadySelected);
|
this.selectButton.classList.toggle('hidden', alreadySelected);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user