mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2025-09-12 17:52:13 +02:00
Deselect All Bug fix
Deselect All button no longer appears after Page Select is turned off
This commit is contained in:
parent
d64fec090f
commit
f66cadaf2c
@ -587,22 +587,29 @@ class PdfContainer {
|
|||||||
const selectIcon = document.getElementById('select-All-Container');
|
const selectIcon = document.getElementById('select-All-Container');
|
||||||
const deselectIcon = document.getElementById('deselect-All-Container');
|
const deselectIcon = document.getElementById('deselect-All-Container');
|
||||||
|
|
||||||
//Check if no pages are selected
|
if (window.selectPage) { // Check if selectPage mode is active
|
||||||
if (window.selectedPages.length === 0) {
|
console.log("Page Select on. Showing buttons");
|
||||||
this.showButton(selectIcon, true);
|
//Check if no pages are selected
|
||||||
this.showButton(deselectIcon, false);
|
if (window.selectedPages.length === 0) {
|
||||||
} else {
|
this.showButton(selectIcon, true);
|
||||||
this.showButton(deselectIcon, true);
|
this.showButton(deselectIcon, false);
|
||||||
}
|
} else {
|
||||||
|
this.showButton(deselectIcon, true);
|
||||||
|
}
|
||||||
|
|
||||||
//Check if all pages are selected
|
//Check if all pages are selected
|
||||||
const allCheckboxes = document.querySelectorAll('.pdf-actions_checkbox');
|
const allCheckboxes = document.querySelectorAll('.pdf-actions_checkbox');
|
||||||
const allSelected = Array.from(allCheckboxes).every((checkbox) => checkbox.checked);
|
const allSelected = Array.from(allCheckboxes).every((checkbox) => checkbox.checked);
|
||||||
if (allSelected) {
|
if (allSelected) {
|
||||||
this.showButton(selectIcon, false);
|
this.showButton(selectIcon, false);
|
||||||
this.showButton(deselectIcon, true);
|
this.showButton(deselectIcon, true);
|
||||||
|
} else {
|
||||||
|
this.showButton(selectIcon, true);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
this.showButton(selectIcon, true);
|
console.log("Page Select off. Hidding buttons");
|
||||||
|
this.showButton(selectIcon, false);
|
||||||
|
this.showButton(deselectIcon, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user