mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Fix:修复概要节点会显示快速创建子节点按钮的问题
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -2,4 +2,5 @@ node_modules
|
||||
.DS_Store
|
||||
dist_electron
|
||||
simple-mind-map/dist
|
||||
simple-mind-map/types
|
||||
simple-mind-map/types
|
||||
utools/dist
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user