From 545e46babcc1f34ffdf67e51744ad9114a769cd1 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Wed, 4 Oct 2023 16:01:47 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=E6=B2=A1=E6=9C=89=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E5=8D=8F=E5=90=8C=E6=8F=92=E4=BB=B6=E6=97=B6=E4=B8=8D=E7=BB=99?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E5=AE=9E=E4=BE=8B=E6=B7=BB=E5=8A=A0=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/core/render/node/Node.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/simple-mind-map/src/core/render/node/Node.js b/simple-mind-map/src/core/render/node/Node.js index 8dc840d1..9df52019 100644 --- a/simple-mind-map/src/core/render/node/Node.js +++ b/simple-mind-map/src/core/render/node/Node.js @@ -126,9 +126,11 @@ class Node { this[item] = nodeCreateContentsMethods[item].bind(this) }) // 协同相关 - Object.keys(nodeCooperateMethods).forEach((item) => { - this[item] = nodeCooperateMethods[item].bind(this) - }) + if (this.mindMap.cooperate) { + Object.keys(nodeCooperateMethods).forEach((item) => { + this[item] = nodeCooperateMethods[item].bind(this) + }) + } // 初始化 this.getSize() } @@ -291,7 +293,8 @@ class Node { this.group.add(this.shapeNode) // 渲染一个隐藏的矩形区域,用来触发展开收起按钮的显示 this.renderExpandBtnPlaceholderRect() - this.createUserListNode() + // 创建协同头像节点 + if (this.createUserListNode) this.createUserListNode() // 概要节点添加一个带所属节点id的类名 if (this.isGeneralization && this.generalizationBelongNode) { this.group.addClass('generalization_' + this.generalizationBelongNode.uid) @@ -536,7 +539,8 @@ class Node { } // 更新概要 this.renderGeneralization() - this.updateUserListNode() + // 更新协同头像 + if (this.updateUserListNode) this.updateUserListNode() // 更新节点位置 let t = this.group.transform() // // 如果上次不在可视区内,且本次也不在,那么直接返回