mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-22 15:53:01 +00:00
Disallow MultiModal dismissal while loading
This commit is contained in:
parent
6ad52f8996
commit
b422913d7c
1 changed files with 6 additions and 3 deletions
|
@ -9,7 +9,7 @@
|
|||
<template v-else>
|
||||
<figure>
|
||||
<figcaption class="tag is-primary">
|
||||
{{ figure_caption }}
|
||||
{{ caption }}
|
||||
</figcaption>
|
||||
<div class="image is-square">
|
||||
<img :src="image_src" alt="Kalender-Bild" />
|
||||
|
@ -30,7 +30,7 @@ export default class extends Vue {
|
|||
public active = false;
|
||||
public progress = false;
|
||||
public image_src = "";
|
||||
public figure_caption = "";
|
||||
public caption = "";
|
||||
|
||||
private on_keydown(e: KeyboardEvent) {
|
||||
if (e.key == "Escape") this.set_active(false);
|
||||
|
@ -49,13 +49,16 @@ export default class extends Vue {
|
|||
}
|
||||
|
||||
public set_active(state: boolean) {
|
||||
// Cannot dismiss the "loading" screen
|
||||
if (this.active && this.progress) return;
|
||||
|
||||
this.active = state;
|
||||
}
|
||||
|
||||
public show_image(src: string, caption: string = "") {
|
||||
this.progress = false;
|
||||
this.image_src = src;
|
||||
this.figure_caption = caption;
|
||||
this.caption = caption;
|
||||
this.set_active(true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue