diff --git a/ui/src/components/Calendar.vue b/ui/src/components/Calendar.vue
index e6d1930..2345beb 100644
--- a/ui/src/components/Calendar.vue
+++ b/ui/src/components/Calendar.vue
@@ -50,8 +50,8 @@ export default class extends Vue {
multi_modal: MultiModal;
};
- public door_hover(index: number) {
- this.figure_caption = `Türchen ${index + 1}`;
+ public door_hover(day: number) {
+ this.figure_caption = `Türchen ${day}`;
}
public door_unhover() {
diff --git a/ui/src/components/ConfigView.vue b/ui/src/components/ConfigView.vue
index 7ac3994..60221f7 100644
--- a/ui/src/components/ConfigView.vue
+++ b/ui/src/components/ConfigView.vue
@@ -16,11 +16,12 @@
Reihenfolge
- –
+ –
{{ day_part.day }}:
{{ day_part.part }}
@@ -64,11 +65,12 @@
Türchen
- ,
+ ,
{{ day_part.day }}
@@ -85,8 +87,8 @@
Schriftarten
{{ font.file }} (Größe {{ font.size }})
diff --git a/ui/src/components/DoorMapEditor.vue b/ui/src/components/DoorMapEditor.vue
index b24a41b..627d38d 100644
--- a/ui/src/components/DoorMapEditor.vue
+++ b/ui/src/components/DoorMapEditor.vue
@@ -89,10 +89,6 @@ export default class extends Vue {
const data: DoorsSaved = [];
for (const door of this.doors) {
- if (door.day === -1) {
- continue;
- }
-
data.push(door.save());
}
diff --git a/ui/src/components/editor/PreviewDoor.vue b/ui/src/components/editor/PreviewDoor.vue
index 74a7e1e..3208dae 100644
--- a/ui/src/components/editor/PreviewDoor.vue
+++ b/ui/src/components/editor/PreviewDoor.vue
@@ -18,12 +18,12 @@
ref="day_input"
class="input is-large"
type="number"
- min="-1"
+ :min="MIN_DAY"
placeholder="Tag"
@keydown="on_keydown"
/>
-
-
{{ door.day }}
+
+ {{ door.day }}
@@ -46,6 +46,7 @@ import SVGRect from "../calendar/SVGRect.vue";
})
export default class extends Vue {
public door!: Door;
+ public readonly MIN_DAY = Door.MIN_DAY;
public day_str = "";
public editing = false;
diff --git a/ui/src/lib/door.ts b/ui/src/lib/door.ts
index 5ddd45a..0c2ea81 100644
--- a/ui/src/lib/door.ts
+++ b/ui/src/lib/door.ts
@@ -12,12 +12,14 @@ export interface DoorSaved {
export type DoorsSaved = DoorSaved[];
export class Door {
- private _day = -1;
+ public static readonly MIN_DAY = 1;
+
+ private _day = Door.MIN_DAY;
public position: Rectangle;
constructor(position: Rectangle);
constructor(position: Rectangle, day: number);
- constructor(position: Rectangle, day = -1) {
+ constructor(position: Rectangle, day = Door.MIN_DAY) {
this.day = day;
this.position = position;
}
@@ -31,9 +33,9 @@ export class Door {
const result = Number(day);
if (isNaN(result)) {
- this._day = -1;
+ this._day = Door.MIN_DAY;
} else {
- this._day = Math.max(Math.floor(result), -1);
+ this._day = Math.max(Math.floor(result), Door.MIN_DAY);
}
}