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:
aignatov-bio 2025-05-06 10:03:52 +02:00 committed by GitHub
commit 28c5d5fa11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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');
});
}
}
}
};