mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Fix:修复概要节点会显示快速创建子节点按钮的问题
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ node_modules
|
|||||||
dist_electron
|
dist_electron
|
||||||
simple-mind-map/dist
|
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'
|
import { SVG, Circle, G } from '@svgdotjs/svg.js'
|
||||||
|
|
||||||
function initQuickCreateChildBtn() {
|
function initQuickCreateChildBtn() {
|
||||||
|
if (this.isGeneralization) return
|
||||||
this._quickCreateChildBtn = null
|
this._quickCreateChildBtn = null
|
||||||
this._showQuickCreateChildBtn = false
|
this._showQuickCreateChildBtn = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 显示按钮
|
// 显示按钮
|
||||||
function showQuickCreateChildBtn() {
|
function showQuickCreateChildBtn() {
|
||||||
if (this.getChildrenLength() > 0) return
|
if (this.isGeneralization || this.getChildrenLength() > 0) return
|
||||||
// 创建按钮
|
// 创建按钮
|
||||||
if (this._quickCreateChildBtn) {
|
if (this._quickCreateChildBtn) {
|
||||||
this.group.add(this._quickCreateChildBtn)
|
this.group.add(this._quickCreateChildBtn)
|
||||||
@@ -63,6 +64,7 @@ function showQuickCreateChildBtn() {
|
|||||||
|
|
||||||
// 移除按钮
|
// 移除按钮
|
||||||
function removeQuickCreateChildBtn() {
|
function removeQuickCreateChildBtn() {
|
||||||
|
if (this.isGeneralization) return
|
||||||
if (this._quickCreateChildBtn && this._showQuickCreateChildBtn) {
|
if (this._quickCreateChildBtn && this._showQuickCreateChildBtn) {
|
||||||
this._quickCreateChildBtn.remove()
|
this._quickCreateChildBtn.remove()
|
||||||
this._showQuickCreateChildBtn = false
|
this._showQuickCreateChildBtn = false
|
||||||
@@ -71,6 +73,7 @@ function removeQuickCreateChildBtn() {
|
|||||||
|
|
||||||
// 隐藏按钮
|
// 隐藏按钮
|
||||||
function hideQuickCreateChildBtn() {
|
function hideQuickCreateChildBtn() {
|
||||||
|
if (this.isGeneralization) return
|
||||||
const { isActive } = this.getData()
|
const { isActive } = this.getData()
|
||||||
if (!isActive) {
|
if (!isActive) {
|
||||||
this.removeQuickCreateChildBtn()
|
this.removeQuickCreateChildBtn()
|
||||||
|
|||||||
Reference in New Issue
Block a user