add NodeBook NodeView click for ordering
This commit is contained in:
+1
-24
@@ -10,6 +10,7 @@
|
||||
class="library-node-book no-events-container"
|
||||
@open-node="openNode"
|
||||
@close-node="closeNode"
|
||||
@select-node="openNode"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -50,30 +51,6 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onMainTextClick (mainTextIndex) {
|
||||
if (mainTextIndex === this.texts.length - 1) return
|
||||
this.parents.push(this.parents.splice(mainTextIndex, 1)[0])
|
||||
this.updateQuery(this.parents)
|
||||
},
|
||||
|
||||
onSubTextClick (mainTextIndex, subTextIndex) {
|
||||
// FIXME clean this
|
||||
const children = this.parents[mainTextIndex].children
|
||||
let needUpdate = false
|
||||
if (subTextIndex !== children.length - 1) {
|
||||
children.push(children.splice(subTextIndex, 1)[0])
|
||||
needUpdate = true
|
||||
}
|
||||
if (mainTextIndex !== this.texts.length - 1) {
|
||||
this.parents.push(this.parents.splice(mainTextIndex, 1)[0])
|
||||
needUpdate = true
|
||||
}
|
||||
|
||||
if (needUpdate) {
|
||||
this.updateQuery(this.parents)
|
||||
}
|
||||
},
|
||||
|
||||
openNode (ids) {
|
||||
this.$store.dispatch('OPEN_NODE', ids)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user