Fix:修复点击节点也会触发node_dragend事件的问题
This commit is contained in:
parent
0fa731c3a2
commit
79a39f993d
@ -1,4 +1,9 @@
|
|||||||
import { bfsWalk, throttle, getTopAncestorsFomNodeList, getNodeIndexInNodeList } from '../utils'
|
import {
|
||||||
|
bfsWalk,
|
||||||
|
throttle,
|
||||||
|
getTopAncestorsFomNodeList,
|
||||||
|
getNodeIndexInNodeList
|
||||||
|
} from '../utils'
|
||||||
import Base from '../layouts/Base'
|
import Base from '../layouts/Base'
|
||||||
|
|
||||||
// 节点拖动插件
|
// 节点拖动插件
|
||||||
@ -108,9 +113,7 @@ class Drag extends Base {
|
|||||||
node.endDrag()
|
node.endDrag()
|
||||||
})
|
})
|
||||||
this.removeCloneNode()
|
this.removeCloneNode()
|
||||||
let overlapNodeUid = this.overlapNode
|
let overlapNodeUid = this.overlapNode ? this.overlapNode.getData('uid') : ''
|
||||||
? this.overlapNode.getData('uid')
|
|
||||||
: ''
|
|
||||||
let prevNodeUid = this.prevNode ? this.prevNode.getData('uid') : ''
|
let prevNodeUid = this.prevNode ? this.prevNode.getData('uid') : ''
|
||||||
let nextNodeUid = this.nextNode ? this.nextNode.getData('uid') : ''
|
let nextNodeUid = this.nextNode ? this.nextNode.getData('uid') : ''
|
||||||
// 存在重叠子节点,则移动作为其子节点
|
// 存在重叠子节点,则移动作为其子节点
|
||||||
@ -162,12 +165,14 @@ class Drag extends Base {
|
|||||||
)
|
)
|
||||||
this.mindMap.render()
|
this.mindMap.render()
|
||||||
}
|
}
|
||||||
|
if (this.isDragging) {
|
||||||
|
this.mindMap.emit('node_dragend', {
|
||||||
|
overlapNodeUid,
|
||||||
|
prevNodeUid,
|
||||||
|
nextNodeUid
|
||||||
|
})
|
||||||
|
}
|
||||||
this.reset()
|
this.reset()
|
||||||
this.mindMap.emit('node_dragend', {
|
|
||||||
overlapNodeUid,
|
|
||||||
prevNodeUid,
|
|
||||||
nextNodeUid
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拖动中
|
// 拖动中
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user