Fix:修复只读模式下按住节点无法拖动画布的问题

This commit is contained in:
wanglin2 2023-08-02 20:00:08 +08:00
parent f1748e7e42
commit c845a0b7fa

View File

@ -385,10 +385,10 @@ class Node {
this.active(e)
})
this.group.on('mousedown', e => {
if (this.isRoot && e.which === 3) {
if (this.isRoot && e.which === 3 && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
if (!this.isRoot) {
if (!this.isRoot && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
// 多选和取消多选
@ -414,7 +414,7 @@ class Node {
this.mindMap.emit('node_mousedown', this, e)
})
this.group.on('mouseup', e => {
if (!this.isRoot) {
if (!this.isRoot && !this.mindMap.opt.readonly) {
e.stopPropagation()
}
this.mindMap.emit('node_mouseup', this, e)