Loading src/components/CollectionsTree.vue +22 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ export default { return { items: [], selectedCollection : null, selectedCollections: [] emulate: false } }, mounted() { Loading @@ -56,11 +56,26 @@ export default { document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active } if(this.selectedCollection && this.selectedCollection.id !== this.currentCollection.id){ document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active try { const target = document.querySelector('#tree-item-' + this.currentCollection.id) .parentElement.parentElement; this.emulate = true; target.click(); } // eslint-disable-next-line no-empty catch(e){} } } }, methods: { async collectionClicked(c){ this.selectedCollection = c; if(this.emulate) return; await this.fetchCollections(this.selectedCollection); }, Loading Loading @@ -103,7 +118,13 @@ export default { if(values.length !== 1) return false; this.selectedCollection = values[0]; if(this.emulate){ this.emulate = false; return; } else { this.$emit('tree-collection-selected', this.selectedCollection.id); } }, loadHome(){ Loading Loading
src/components/CollectionsTree.vue +22 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,7 @@ export default { return { items: [], selectedCollection : null, selectedCollections: [] emulate: false } }, mounted() { Loading @@ -56,11 +56,26 @@ export default { document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active } if(this.selectedCollection && this.selectedCollection.id !== this.currentCollection.id){ document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active try { const target = document.querySelector('#tree-item-' + this.currentCollection.id) .parentElement.parentElement; this.emulate = true; target.click(); } // eslint-disable-next-line no-empty catch(e){} } } }, methods: { async collectionClicked(c){ this.selectedCollection = c; if(this.emulate) return; await this.fetchCollections(this.selectedCollection); }, Loading Loading @@ -103,7 +118,13 @@ export default { if(values.length !== 1) return false; this.selectedCollection = values[0]; if(this.emulate){ this.emulate = false; return; } else { this.$emit('tree-collection-selected', this.selectedCollection.id); } }, loadHome(){ Loading