Feat:新增拦截关联线创建的实例化选项
This commit is contained in:
parent
b661e8cc92
commit
0dd7b0ed03
@ -358,6 +358,8 @@ export const defaultOpt = {
|
|||||||
},
|
},
|
||||||
// 是否允许调整关联线两个端点的位置
|
// 是否允许调整关联线两个端点的位置
|
||||||
enableAdjustAssociativeLinePoints: true,
|
enableAdjustAssociativeLinePoints: true,
|
||||||
|
// 关联线连接即将完成时执行,如果要阻止本次连接可以返回true,函数接收一个参数:node(目标节点实例)
|
||||||
|
beforeAssociativeLineConnection: null,
|
||||||
|
|
||||||
// 【TouchEvent插件】
|
// 【TouchEvent插件】
|
||||||
// 禁止双指缩放,你仍旧可以使用api进行缩放
|
// 禁止双指缩放,你仍旧可以使用api进行缩放
|
||||||
|
|||||||
@ -446,6 +446,12 @@ class AssociativeLine {
|
|||||||
// 完成创建连接线
|
// 完成创建连接线
|
||||||
completeCreateLine(node) {
|
completeCreateLine(node) {
|
||||||
if (this.creatingStartNode.uid === node.uid) return
|
if (this.creatingStartNode.uid === node.uid) return
|
||||||
|
const { beforeAssociativeLineConnection } = this.mindMap.opt
|
||||||
|
let stop = false
|
||||||
|
if (typeof beforeAssociativeLineConnection === 'function') {
|
||||||
|
stop = beforeAssociativeLineConnection(node)
|
||||||
|
}
|
||||||
|
if (stop) return
|
||||||
this.addLine(this.creatingStartNode, node)
|
this.addLine(this.creatingStartNode, node)
|
||||||
if (this.overlapNode && this.overlapNode.getData('isActive')) {
|
if (this.overlapNode && this.overlapNode.getData('isActive')) {
|
||||||
this.mindMap.execCommand('SET_NODE_ACTIVE', this.overlapNode, false)
|
this.mindMap.execCommand('SET_NODE_ACTIVE', this.overlapNode, false)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user