mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 06:35:56 +08:00
Merge pull request #7350 from rekonder/aj_SCI_10505
Prevent tags creation on opening tags modal [SCI-10505]
This commit is contained in:
commit
43e57e7f01
|
@ -166,7 +166,7 @@
|
|||
},
|
||||
onUnSelect: (id) => {
|
||||
$.post(`${$(myModuleTagsSelector).data('update-module-tags-url')}/${id}/destroy_by_tag_id`)
|
||||
.success(function() {
|
||||
.done(() => {
|
||||
dropdownSelector.closeDropdown(myModuleTagsSelector);
|
||||
})
|
||||
.fail(function(r) {
|
||||
|
|
|
@ -187,7 +187,7 @@ export default {
|
|||
}
|
||||
},
|
||||
created() {
|
||||
this.loadAlltags();
|
||||
this.loadAlltags(false);
|
||||
},
|
||||
methods: {
|
||||
startEditMode(tag) {
|
||||
|
@ -211,15 +211,15 @@ export default {
|
|||
this.updateTag(this.tagToUpdate);
|
||||
}
|
||||
},
|
||||
loadAlltags() {
|
||||
loadAlltags(emitTagsLoaded = true) {
|
||||
this.loadingTags = true;
|
||||
axios.get(this.projectTagsUrl).then((response) => {
|
||||
this.allTags = response.data.data;
|
||||
|
||||
this.loadAssignedTags();
|
||||
this.loadAssignedTags(emitTagsLoaded);
|
||||
});
|
||||
},
|
||||
loadAssignedTags() {
|
||||
loadAssignedTags(emitTagsLoaded = true) {
|
||||
axios.get(this.params.urls.assigned_tags).then((response) => {
|
||||
this.assignedTags = response.data.data;
|
||||
this.allTags.forEach((tag) => {
|
||||
|
@ -231,7 +231,9 @@ export default {
|
|||
tag.assigned = false;
|
||||
}
|
||||
});
|
||||
this.$emit('tagsLoaded', this.allTags);
|
||||
if (emitTagsLoaded) {
|
||||
this.$emit('tagsLoaded', this.allTags);
|
||||
}
|
||||
this.loadingTags = false;
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue