mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-09-13 00:24:42 +08:00
Merge pull request #8480 from aignatov-bio/ai-sci-11857-add-read-edit-toggle
Add read/edit modal description mode [SCI-11857]
This commit is contained in:
commit
28c5d5fa11
1 changed files with 15 additions and 6 deletions
|
@ -59,6 +59,11 @@ export default {
|
|||
editMode: false
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (!this.object.description || this.object.description === '') {
|
||||
this.editMode = true;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
window.renderElementSmartAnnotations(this.$refs.description, 'span');
|
||||
|
@ -71,12 +76,16 @@ export default {
|
|||
this.$emit('close');
|
||||
},
|
||||
cancelEdit() {
|
||||
this.editMode = false;
|
||||
this.description = this.object.description;
|
||||
this.$refs.description.classList.remove('sa-initialized');
|
||||
this.$nextTick(() => {
|
||||
window.renderElementSmartAnnotations(this.$refs.description, 'span');
|
||||
});
|
||||
if (!this.object.description || this.object.description === '') {
|
||||
this.$emit('close');
|
||||
} else {
|
||||
this.editMode = false;
|
||||
this.description = this.object.description;
|
||||
this.$refs.description.classList.remove('sa-initialized');
|
||||
this.$nextTick(() => {
|
||||
window.renderElementSmartAnnotations(this.$refs.description, 'span');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue