Loading src/components/CollectionsTree.vue +20 −5 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ </v-toolbar> <v-treeview ref="collectionTreeView" dense :items="collectionsTree" :load-children="collectionClicked" Loading Loading @@ -59,9 +60,21 @@ export default { watch: { currentCollection(){ //console.log(this.openNodes); // if(this.active.length === 0 || this.active[0].id !== this.currentCollection.id){ // let a = this.$store.getters.collectionsTreeNodeById(this.currentCollection.id); // this.active = [a]; // this.openNodes = this.openNodes.concat([a]).map((e)=>this.$store.getters.collectionsTreeNodeById(e.id)); // // console.log(this.active); // } if (this.highlightedNode && this.highlightedNode.id !== this.currentCollection.id) { document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active } /*if (this.currentCollection.id === this.currentRootCollectionId) {//home clicked this.highlightedNode = null; document.querySelectorAll('.v-treeview-node--active') Loading @@ -79,7 +92,7 @@ export default { catch (e) { } }*/ } // } } }, Loading @@ -90,7 +103,7 @@ export default { // return; // } await this.fetchCollectionTree(c.id); this.$emit('tree-collection-selected', c.id); //this.$emit('tree-collection-selected', c.id); }, async activeItemChanged(values) { Loading @@ -98,15 +111,17 @@ export default { this.highlightedNode = values[0]; this.$emit('tree-collection-selected', values[0].id) } else{ console.log("VALUES != 1", values.length, 'inactive!') } }, loadHome() { this.$emit('tree-collection-selected', this.currentRootCollectionId); }, onOpen(items) { this.openIds = items; console.log(this.openIds) }, ...mapActions(["fetchCollectionTree", "fetchCollections"]) } Loading src/store/JamaStore.js +4 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,10 @@ export default new Vuex.Store({ sortOptions: state => state.sortOptions, currentStats: state => state.currentStats, filter: state => state.filter, multiSelectActionAddons: state => state.multiSelectActionAddons multiSelectActionAddons: state => state.multiSelectActionAddons, // collectionsTreeNodeById: (state) => (id) => { // return findItem(id,state.collectionsTree) // } }, mutations: { Loading Loading
src/components/CollectionsTree.vue +20 −5 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ </v-toolbar> <v-treeview ref="collectionTreeView" dense :items="collectionsTree" :load-children="collectionClicked" Loading Loading @@ -59,9 +60,21 @@ export default { watch: { currentCollection(){ //console.log(this.openNodes); // if(this.active.length === 0 || this.active[0].id !== this.currentCollection.id){ // let a = this.$store.getters.collectionsTreeNodeById(this.currentCollection.id); // this.active = [a]; // this.openNodes = this.openNodes.concat([a]).map((e)=>this.$store.getters.collectionsTreeNodeById(e.id)); // // console.log(this.active); // } if (this.highlightedNode && this.highlightedNode.id !== this.currentCollection.id) { document.querySelectorAll('.v-treeview-node--active') .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active } /*if (this.currentCollection.id === this.currentRootCollectionId) {//home clicked this.highlightedNode = null; document.querySelectorAll('.v-treeview-node--active') Loading @@ -79,7 +92,7 @@ export default { catch (e) { } }*/ } // } } }, Loading @@ -90,7 +103,7 @@ export default { // return; // } await this.fetchCollectionTree(c.id); this.$emit('tree-collection-selected', c.id); //this.$emit('tree-collection-selected', c.id); }, async activeItemChanged(values) { Loading @@ -98,15 +111,17 @@ export default { this.highlightedNode = values[0]; this.$emit('tree-collection-selected', values[0].id) } else{ console.log("VALUES != 1", values.length, 'inactive!') } }, loadHome() { this.$emit('tree-collection-selected', this.currentRootCollectionId); }, onOpen(items) { this.openIds = items; console.log(this.openIds) }, ...mapActions(["fetchCollectionTree", "fetchCollections"]) } Loading
src/store/JamaStore.js +4 −1 Original line number Diff line number Diff line Loading @@ -98,7 +98,10 @@ export default new Vuex.Store({ sortOptions: state => state.sortOptions, currentStats: state => state.currentStats, filter: state => state.filter, multiSelectActionAddons: state => state.multiSelectActionAddons multiSelectActionAddons: state => state.multiSelectActionAddons, // collectionsTreeNodeById: (state) => (id) => { // return findItem(id,state.collectionsTree) // } }, mutations: { Loading