mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
comment in accompanying course: add loader + fix when resetting to empty string
This commit is contained in:
parent
ded2ac7d48
commit
a8b6609dbf
@ -21,6 +21,7 @@
|
||||
tag-name="textarea">
|
||||
</ckeditor>
|
||||
|
||||
<div class="sub-comment">
|
||||
<div v-if="pinnedComment" class="metadata">
|
||||
{{ $t('comment.created_by', [
|
||||
pinnedComment.creator.text,
|
||||
@ -28,6 +29,10 @@
|
||||
])
|
||||
}}
|
||||
</div>
|
||||
<div class="loading">
|
||||
<i v-if="loading" class="fa fa-circle-o-notch fa-spin" :title="$t('loading')"></i>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<ul class="record_actions">
|
||||
@ -62,7 +67,8 @@ export default {
|
||||
formData: {
|
||||
type: "accompanying_period_comment",
|
||||
content: ''
|
||||
}
|
||||
},
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@ -83,8 +89,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
onContentChange() {
|
||||
this.loading = true;
|
||||
let lastRecordedContent = this.formData.content;
|
||||
setTimeout(() => {
|
||||
if (this.formData.content !== '') {
|
||||
if (lastRecordedContent === this.formData.content) {
|
||||
if (this.pinnedComment) {
|
||||
let body = this.formData;
|
||||
@ -110,6 +118,8 @@ export default {
|
||||
}
|
||||
lastRecordedContent = null;
|
||||
}
|
||||
}
|
||||
this.loading = false;
|
||||
}, 3000);
|
||||
},
|
||||
removeComment() {
|
||||
@ -130,4 +140,12 @@ export default {
|
||||
div.ck-editor.ck-reset {
|
||||
margin: 0.6em 0;
|
||||
}
|
||||
div.sub-comment {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div.loading {
|
||||
margin-right: 6px;
|
||||
margin-left: 6px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user