mirror of
https://code.lenaisten.de/Lenaisten/advent22.git
synced 2024-11-22 15:53:01 +00:00
DoorMapEditor Drawer usage
This commit is contained in:
parent
dbd0e4962c
commit
ddb893ea6c
1 changed files with 13 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<BulmaDrawer header="Türchen bearbeiten">
|
||||
<BulmaDrawer header="Türchen bearbeiten" :ready="is_loaded" @open="on_open">
|
||||
<div class="is-flex is-align-items-center is-justify-content-space-between">
|
||||
<BulmaButton
|
||||
:disabled="current_step === 0"
|
||||
|
@ -67,6 +67,8 @@ import DoorPlacer from "./editor/DoorPlacer.vue";
|
|||
},
|
||||
})
|
||||
export default class extends Vue {
|
||||
public is_loaded = true;
|
||||
|
||||
public readonly steps: Step[] = [
|
||||
{ label: "Platzieren", icon: "fa-solid fa-crosshairs" },
|
||||
{ label: "Ordnen", icon: "fa-solid fa-list-ol" },
|
||||
|
@ -95,6 +97,16 @@ export default class extends Vue {
|
|||
return this.$advent22.api_put("admin/doors", data);
|
||||
}
|
||||
|
||||
public on_open(): void {
|
||||
this.is_loaded = false;
|
||||
|
||||
this.load_doors()
|
||||
.then(() => (this.is_loaded = true))
|
||||
.catch(([reason, endpoint]) => {
|
||||
alert(`Fehler: ${reason} in ${endpoint}`);
|
||||
});
|
||||
}
|
||||
|
||||
public mounted(): void {
|
||||
this.load_doors().catch(([reason, endpoint]) => {
|
||||
alert(`Fehler: ${reason} in ${endpoint}`);
|
||||
|
|
Loading…
Reference in a new issue