mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-23 00:03:07 +00:00
ESC login
This commit is contained in:
parent
82ebd211f6
commit
e53619ebcf
1 changed files with 7 additions and 1 deletions
|
@ -26,7 +26,7 @@
|
|||
</section>
|
||||
|
||||
<footer class="modal-card-foot">
|
||||
<button class="button is-success" @click="submit">Login</button>
|
||||
<button class="button is-success" @click="submit()">Login</button>
|
||||
<button class="button is-danger" @click="set_active(false)">
|
||||
Cancel
|
||||
</button>
|
||||
|
@ -44,6 +44,12 @@ export default class LoginModal extends Vue {
|
|||
private username = "";
|
||||
private password = "";
|
||||
|
||||
public created(): void {
|
||||
window.addEventListener("keydown", (e) => {
|
||||
if (e.key == "Escape") this.set_active(false);
|
||||
});
|
||||
}
|
||||
|
||||
public set_active(state: boolean): void {
|
||||
this.active = state;
|
||||
|
||||
|
|
Loading…
Reference in a new issue