Add loading message for spellcheck
This commit is contained in:
parent
680b78e904
commit
919c0aec18
|
|
@ -15,6 +15,7 @@
|
||||||
@changeDocumentUrl="changeDocumentUrl"
|
@changeDocumentUrl="changeDocumentUrl"
|
||||||
@spellcheck="spellcheck"
|
@spellcheck="spellcheck"
|
||||||
:user-input="submission"
|
:user-input="submission"
|
||||||
|
:spellcheck-loading="spellcheckLoading"
|
||||||
placeholder="Ergebnis erfassen"
|
placeholder="Ergebnis erfassen"
|
||||||
action="Ergebnis mit Lehrperson teilen"
|
action="Ergebnis mit Lehrperson teilen"
|
||||||
shared-msg="Das Ergebnis wurde mit der Lehrperson geteilt."
|
shared-msg="Das Ergebnis wurde mit der Lehrperson geteilt."
|
||||||
|
|
@ -191,6 +192,7 @@
|
||||||
},
|
},
|
||||||
spellcheck() {
|
spellcheck() {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
this.spellcheckLoading = true;
|
||||||
this.$apollo.mutate({
|
this.$apollo.mutate({
|
||||||
mutation: SPELL_CHECK_MUTATION,
|
mutation: SPELL_CHECK_MUTATION,
|
||||||
variables: {
|
variables: {
|
||||||
|
|
@ -202,6 +204,8 @@
|
||||||
update(store, {data: {spellCheck: {results}}}) {
|
update(store, {data: {spellCheck: {results}}}) {
|
||||||
self.corrections = results;
|
self.corrections = results;
|
||||||
}
|
}
|
||||||
|
}).then(() => {
|
||||||
|
this.spellcheckLoading = false;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -239,7 +243,8 @@
|
||||||
inputType: 'text',
|
inputType: 'text',
|
||||||
unsaved: false,
|
unsaved: false,
|
||||||
saving: 0,
|
saving: 0,
|
||||||
corrections: ''
|
corrections: '',
|
||||||
|
spellcheckLoading: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg"
|
class="submission-form-container__submit submission-form-container__spellcheck button button--primary button--white-bg"
|
||||||
v-if="spellcheck"
|
v-if="spellcheck"
|
||||||
@click="$emit('spellcheck')"
|
@click="$emit('spellcheck')"
|
||||||
>Rechtschreibung prüfen
|
>{{spellcheckText}}
|
||||||
</button>
|
</button>
|
||||||
<div v-if="userInput.document">
|
<div v-if="userInput.document">
|
||||||
<document-block
|
<document-block
|
||||||
|
|
@ -65,6 +65,10 @@
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
},
|
},
|
||||||
|
spellcheckLoading: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
},
|
||||||
sharedMsg: String
|
sharedMsg: String
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -81,6 +85,14 @@
|
||||||
},
|
},
|
||||||
allowsDocuments() {
|
allowsDocuments() {
|
||||||
return 'document' in this.userInput;
|
return 'document' in this.userInput;
|
||||||
|
},
|
||||||
|
spellcheckText() {
|
||||||
|
if (!this.spellcheckLoading) {
|
||||||
|
return 'Rechtschreibung prüfen'
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return 'Wird geprüft...'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -129,6 +141,13 @@
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&__spellcheck {
|
||||||
|
/* so the button does not change size when changing the text */
|
||||||
|
width: 235px;
|
||||||
|
text-align: center;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue