mirror of
https://github.com/gchq/CyberChef.git
synced 2025-06-15 18:54:56 -04:00
added deselect and select of checkbox by Enter key
This commit is contained in:
parent
61d587a4a5
commit
68a8d4328f
2 changed files with 22 additions and 0 deletions
|
@ -51,6 +51,27 @@ class ControlsWaiter {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles the Auto Bake checkbox based on keyboard.
|
||||
*
|
||||
*/
|
||||
keyboardCheckAutoBake() {
|
||||
const autoBakeId = document.getElementById("auto-bake");
|
||||
autoBakeId.addEventListener("keydown", this.autoBakeKeyboardHandler, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks or unchecks the Auto Bake checkbox with "Enter"
|
||||
* @param {Event} ev
|
||||
*/
|
||||
autoBakeKeyboardHandler(ev) {
|
||||
const checkBox = document.getElementById("auto-bake");
|
||||
ev.preventDefault();
|
||||
if (ev.key === "Enter" || ev.key === " ") {
|
||||
checkBox.checked = !checkBox.checked;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handler to trigger baking.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue