diff --git a/src/components/lesson-card.vue b/src/components/lesson-card.vue index 5d3347d..29c87b2 100644 --- a/src/components/lesson-card.vue +++ b/src/components/lesson-card.vue @@ -2,7 +2,7 @@ import { getSubstitutionColor } from "@/util"; import { times } from "@/store"; import { ref, watch } from "vue"; -import { TrashIcon } from "lucide-vue-next"; +import { MinusIcon } from "lucide-vue-next"; const props = defineProps(["lesson", "index", "edit", "buttons"]); const emit = defineEmits(["change", "delete"]); @@ -84,6 +84,7 @@ function getTime(index) { spellcheck="false" data-ph="Subject" ref="subjectElement" + @keydown.enter.prevent @input="update" > {{ lesson.subject }} @@ -102,6 +103,7 @@ function getTime(index) { spellcheck="false" data-ph="Teacher" ref="teacherElement" + @keydown.enter.prevent @input="update" > {{ lesson.teacher }}{{ lesson.room }}{{ getTime(index).end }}
- +
@@ -190,6 +193,9 @@ function getTime(index) { cursor: pointer; } +[contenteditable="true"]:focus { + padding: 0px 5px; +} [contenteditable="true"]:empty:before { content: attr(data-ph); opacity: 0.4; diff --git a/src/components/lesson-group-list.vue b/src/components/lesson-group-list.vue index 677dba6..e45b61c 100644 --- a/src/components/lesson-group-list.vue +++ b/src/components/lesson-group-list.vue @@ -6,7 +6,7 @@ import { ArrowDownIcon, SettingsIcon, TrashIcon, - PlusIcon, + ListPlusIcon, } from "lucide-vue-next"; const props = defineProps(["lesson", "index", "edit"]); @@ -43,19 +43,20 @@ function lessonChanged(index, data) { function lessonDeleted(index) { let newLesson = structuredClone(toRaw(props.lesson)); newLesson.splice(index, 1); + if (newLesson.length == 1) delete newLesson[0].group; if (newLesson.length == 0) emit("delete"); else emit("change", newLesson); }