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>
|
</section>
|
||||||
|
|
||||||
<footer class="modal-card-foot">
|
<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)">
|
<button class="button is-danger" @click="set_active(false)">
|
||||||
Cancel
|
Cancel
|
||||||
</button>
|
</button>
|
||||||
|
@ -44,6 +44,12 @@ export default class LoginModal extends Vue {
|
||||||
private username = "";
|
private username = "";
|
||||||
private password = "";
|
private password = "";
|
||||||
|
|
||||||
|
public created(): void {
|
||||||
|
window.addEventListener("keydown", (e) => {
|
||||||
|
if (e.key == "Escape") this.set_active(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public set_active(state: boolean): void {
|
public set_active(state: boolean): void {
|
||||||
this.active = state;
|
this.active = state;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue