add NodeBook NodeView click for ordering
This commit is contained in:
@@ -41,8 +41,17 @@ export default {
|
||||
if (stack === undefined) {
|
||||
stack = childId === undefined ? [parentId] : [parentId, childId]
|
||||
state.nodebook.push(stack)
|
||||
} else {
|
||||
stack.push(childId)
|
||||
return
|
||||
}
|
||||
if (stack !== undefined && parentId !== undefined) {
|
||||
state.nodebook.push(state.nodebook.splice(state.nodebook.indexOf(stack), 1)[0])
|
||||
}
|
||||
if (childId) {
|
||||
if (stack.includes(childId)) {
|
||||
stack.push(stack.splice(stack.indexOf(childId), 1)[0])
|
||||
} else {
|
||||
stack.push(childId)
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -135,7 +144,6 @@ export default {
|
||||
|
||||
async 'OPEN_NODE' ({ state, commit, dispatch }, { parentId, childId }) {
|
||||
const stack = state.nodebook.find(stack => stack[0] === parentId)
|
||||
if (stack && (childId === undefined || stack.includes(childId))) return
|
||||
commit('ADD_NODEBOOK_NODE', [stack, parentId, childId])
|
||||
dispatch('UPDATE_QUERY_NODES')
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user