Skip to content
Snippets Groups Projects
Commit 540d1cfc authored by Julian's avatar Julian
Browse files

Show loading animation for topic autosave

parent 895e12df
No related branches found
No related tags found
2 merge requests!352Draft: Resolve "Add dialog with each lesson's students",!350Resolve "Add simple course book list"
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
@input="topic=$event" @input="topic=$event"
@focusout="save" @focusout="save"
@keydown.enter="saveAndBlur" @keydown.enter="saveAndBlur"
:loading="loading"
/> />
<v-chip <v-chip
v-if="compact" v-if="compact"
...@@ -84,6 +85,7 @@ export default { ...@@ -84,6 +85,7 @@ export default {
topic: "", topic: "",
homework: "", homework: "",
groupNote: "", groupNote: "",
loading: false,
}; };
}, },
methods: { methods: {
...@@ -94,6 +96,7 @@ export default { ...@@ -94,6 +96,7 @@ export default {
}, },
handleUpdateAfterCreateOrPatch(itemId, wasCreate) { handleUpdateAfterCreateOrPatch(itemId, wasCreate) {
return (cached, incoming) => { return (cached, incoming) => {
this.loading = false;
for (const object of incoming) { for (const object of incoming) {
console.log('summary: handleUpdateAfterCreateOrPatch', object); console.log('summary: handleUpdateAfterCreateOrPatch', object);
// Replace the current documentation // Replace the current documentation
...@@ -110,6 +113,9 @@ export default { ...@@ -110,6 +113,9 @@ export default {
const homework = this.homework ? { homework: this.homework } : {}; const homework = this.homework ? { homework: this.homework } : {};
const groupNote = this.groupNote ? { groupNote: this.groupNote } : {}; const groupNote = this.groupNote ? { groupNote: this.groupNote } : {};
this.loading = true;
console.log("save was called")
this.createOrPatch([{ this.createOrPatch([{
id: this.documentation.id, id: this.documentation.id,
...topic, ...topic,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment