Adding a "Deselect All" button so that you don't need to uncheck all other session in a multi-session environment every time you want to save three single-window session out of, say, 50 windows

This commit is contained in:
CRImier 2020-04-13 20:02:30 +03:00
parent 4b5be7be66
commit 486d35ff0b
3 changed files with 14 additions and 0 deletions

View File

@ -77,6 +77,7 @@
</div>
</div>
<div class="modal-footer align-right">
<button class="button-secondary" name="deselectAll">Deselect all</button>
<button class="button-secondary" name="closeSave">Close</button>
<button class="button-primary" name="save">OK</button>
</div>

View File

@ -67,6 +67,10 @@ document.addEventListener("click", (e) => {
}
}
else if (action.includes("deselectAll")) {
var container = document.getElementById("editSelectionContainer");
deselectAll(container);
}
// Actions
if (/(download|delete|edit|load)/.test(action)) {

View File

@ -193,6 +193,15 @@ const getSelectionData = (container = null, keys = null, keysLength = 0) => {
return sessionData;
}
const deselectAll = (container = null) => {
var selAlls = container.querySelectorAll('.selAll');
for (var i = 0; i < selAlls.length; i++) {
var selAll = selAlls[i];
selAll.checked = false;
toggleSelect(selAll, "Win" + i);
}
}
const doUrlAction = (url = "https://www.paypal.me/ITDominator", fileName = "", isDownload = false) => {
let aTagElm = document.getElementById('downloadAnchorElem');
aTagElm.setAttribute("href", url);