Commit 26a5709e authored by Jerome Chauveau's avatar Jerome Chauveau
Browse files

désactivation (temporaire ?) d'une partie non essentielle de la synchro du treeview

parent 7c0ad2cb
Loading
Loading
Loading
Loading
+13 −6
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ export default {
  data() {
    return {
      highlightedNode: null,
      simulateClick: false,
      //simulateClick: false,
    }
  },
  mounted() {
@@ -60,11 +60,14 @@ export default {

    currentCollection(){
        if (this.highlightedNode && this.highlightedNode.id !== this.currentCollection.id) {
          if (this.currentCollection.id == this.currentRootCollectionId) {//home clicked
          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')
                .forEach((elt) => elt.classList.remove('v-treeview-node--active'))//desactive current active
          } else {//collection was loaded but from external action (no click on treeview)
          } */
        /*else {//collection was loaded but from external action (no click on treeview)
            this.simulateClick = true;
            try {
              const target = document.querySelector('#tree-item-' + this.currentCollection.id)
@@ -75,7 +78,7 @@ export default {
            // eslint-disable-next-line no-empty
            catch (e) {
            }
          }
          }*/
        }

    }
@@ -83,8 +86,9 @@ export default {
  methods: {
    async collectionClicked(c) {
      this.highlightedNode = c;
      if (this.simulateClick)
        return;
      // if (this.simulateClick) {
      //   return;
      // }
      await this.fetchCollectionTree(c.id);
      this.$emit('tree-collection-selected', c.id);
    },
@@ -94,6 +98,9 @@ export default {
        this.highlightedNode = values[0];
        this.$emit('tree-collection-selected', values[0].id)
      }
      else{
        console.log("VALUES != 1", values.length, 'inactive!')
      }
    },

    loadHome() {