From b3705712f2f4e0da50552d70428eb1c05eadc1a2 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Thu, 30 Jan 2025 21:39:04 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=E4=BF=AE=E5=A4=8D=E6=A6=82=E8=A6=81?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E4=BC=9A=E6=98=BE=E7=A4=BA=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=AD=90=E8=8A=82=E7=82=B9=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 ++- simple-mind-map/src/core/render/node/quickCreateChildBtn.js | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f18f78ea..ce3d8a8f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .DS_Store dist_electron simple-mind-map/dist -simple-mind-map/types \ No newline at end of file +simple-mind-map/types +utools/dist \ No newline at end of file diff --git a/simple-mind-map/src/core/render/node/quickCreateChildBtn.js b/simple-mind-map/src/core/render/node/quickCreateChildBtn.js index 257cb883..bf19a3a8 100644 --- a/simple-mind-map/src/core/render/node/quickCreateChildBtn.js +++ b/simple-mind-map/src/core/render/node/quickCreateChildBtn.js @@ -2,13 +2,14 @@ import btnsSvg from '../../../svg/btns' import { SVG, Circle, G } from '@svgdotjs/svg.js' function initQuickCreateChildBtn() { + if (this.isGeneralization) return this._quickCreateChildBtn = null this._showQuickCreateChildBtn = false } // 显示按钮 function showQuickCreateChildBtn() { - if (this.getChildrenLength() > 0) return + if (this.isGeneralization || this.getChildrenLength() > 0) return // 创建按钮 if (this._quickCreateChildBtn) { this.group.add(this._quickCreateChildBtn) @@ -63,6 +64,7 @@ function showQuickCreateChildBtn() { // 移除按钮 function removeQuickCreateChildBtn() { + if (this.isGeneralization) return if (this._quickCreateChildBtn && this._showQuickCreateChildBtn) { this._quickCreateChildBtn.remove() this._showQuickCreateChildBtn = false @@ -71,6 +73,7 @@ function removeQuickCreateChildBtn() { // 隐藏按钮 function hideQuickCreateChildBtn() { + if (this.isGeneralization) return const { isActive } = this.getData() if (!isActive) { this.removeQuickCreateChildBtn()