diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue index 3710a45f83c7d267ba281f95d2cbbaaae95f46f3..6693fa390b5ad558a198d0ca6a2d16570e239c64 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonSummary.vue @@ -155,7 +155,7 @@ export default { documentationCacheUpdateMixin, documentationPartMixin, ], - emits: ["open"], + emits: ["open", "dirty"], data() { return { topic: null, @@ -244,9 +244,25 @@ export default { }[this.appendIcon] || "" ); }, + dirty() { + return !( + this.topic === this.documentation.topic && + this.homework === this.documentation.homework && + this.groupNote === this.documentation.groupNote + ); + }, }, mounted() { this.$on("save", this.handleAppendIconSuccess); + + this.topic = this.documentation.topic; + this.homework = this.documentation.homework; + this.groupNote = this.documentation.groupNote; + }, + watch: { + dirty(dirty) { + this.$emit("dirty", dirty); + }, }, }; </script>