mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-23 12:31:24 +01:00
Lock/unlock in one button
Unlock all burgs and lock all burgs in just one button. Additionally to invert lock.
This commit is contained in:
parent
19fdc24a95
commit
c12650fe9b
2 changed files with 12 additions and 4 deletions
|
|
@ -3284,8 +3284,7 @@
|
|||
<button id="addNewBurg" data-tip="Add a new burg. Hold Shift to add multiple" class="icon-plus"></button>
|
||||
<button id="burgsExport" data-tip="Save burgs-related data as a text file (.csv)" class="icon-download"></button>
|
||||
<button id="burgNamesImport" data-tip="Rename burgs in bulk" class="icon-upload"></button>
|
||||
<button id="burgsLockAll" data-tip="Lock all burgs" class="icon-lock"></button>
|
||||
<button id="burgsUnlockAll" data-tip="Unlock all burgs" class="icon-lock-open-alt"></button>
|
||||
<button id="burgsonoff" data-tip="Lock / Unlock all burgs" class="icon-lock" value="Off"></button>
|
||||
<button id="burgsRemoveAll" data-tip="Remove all unlocked burgs except for capitals. To remove a capital remove its state first" class="icon-trash"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ function overviewBurgs() {
|
|||
document.getElementById("burgsListToLoad").addEventListener("change", function () {
|
||||
uploadFile(this, importBurgNames);
|
||||
});
|
||||
document.getElementById("burgsLockAll").addEventListener("click", lockAllBurgs);
|
||||
document.getElementById("burgsUnlockAll").addEventListener("click", unlockAllBurgs);
|
||||
document.getElementById("burgsonoff").addEventListener("click", burgsonoff);
|
||||
document.getElementById("burgsRemoveAll").addEventListener("click", triggerAllBurgsRemove);
|
||||
document.getElementById("burgsInvertLock").addEventListener("click", invertLock);
|
||||
|
||||
|
|
@ -574,4 +573,14 @@ function overviewBurgs() {
|
|||
burg.lock = false;});
|
||||
burgsOverviewAddLines();
|
||||
}
|
||||
function burgsonoff(){
|
||||
const currentvalue = document.getElementById('burgsonoff').value;
|
||||
if(currentvalue == "Off"){
|
||||
lockAllBurgs();
|
||||
document.getElementById("burgsonoff").value="On";
|
||||
}else{
|
||||
unlockAllBurgs();
|
||||
document.getElementById("burgsonoff").value="Off";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue