mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 10:27:44 +08:00
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'
|
||||
|
||||
// 节点拖动插件
|
||||
@ -108,9 +113,7 @@ class Drag extends Base {
|
||||
node.endDrag()
|
||||
})
|
||||
this.removeCloneNode()
|
||||
let overlapNodeUid = this.overlapNode
|
||||
? this.overlapNode.getData('uid')
|
||||
: ''
|
||||
let overlapNodeUid = this.overlapNode ? this.overlapNode.getData('uid') : ''
|
||||
let prevNodeUid = this.prevNode ? this.prevNode.getData('uid') : ''
|
||||
let nextNodeUid = this.nextNode ? this.nextNode.getData('uid') : ''
|
||||
// 存在重叠子节点,则移动作为其子节点
|
||||
@ -162,12 +165,14 @@ class Drag extends Base {
|
||||
)
|
||||
this.mindMap.render()
|
||||
}
|
||||
if (this.isDragging) {
|
||||
this.mindMap.emit('node_dragend', {
|
||||
overlapNodeUid,
|
||||
prevNodeUid,
|
||||
nextNodeUid
|
||||
})
|
||||
}
|
||||
this.reset()
|
||||
this.mindMap.emit('node_dragend', {
|
||||
overlapNodeUid,
|
||||
prevNodeUid,
|
||||
nextNodeUid
|
||||
})
|
||||
}
|
||||
|
||||
// 拖动中
|
||||
|
||||
Loading…
Reference in New Issue
Block a user