From 4590adc7b076e84fa13e84a6d28306776d42f8c7 Mon Sep 17 00:00:00 2001 From: ssshooter Date: Sat, 8 Jun 2024 21:00:30 +0800 Subject: [PATCH] feat: allow select when editable = false --- package.json | 2 +- src/dev.dist.ts | 1 - src/index.ts | 2 +- src/mouse.ts | 4 ++-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index aa5bd89e..b54ea4aa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mind-elixir", - "version": "4.0.3", + "version": "4.0.4", "type": "module", "description": "Mind elixir is a free open source mind map core.", "keywords": [ diff --git a/src/dev.dist.ts b/src/dev.dist.ts index 024d0219..e6bb155d 100644 --- a/src/dev.dist.ts +++ b/src/dev.dist.ts @@ -38,7 +38,6 @@ const options: Options = { return true }, async addChild(el, obj) { - await sleep() return true }, }, diff --git a/src/index.ts b/src/index.ts index 54e7f40f..9029e191 100644 --- a/src/index.ts +++ b/src/index.ts @@ -129,7 +129,7 @@ MindElixir.DARK_THEME = DARK_THEME * @memberof MindElixir * @static */ -MindElixir.version = '4.0.3' +MindElixir.version = '4.0.4' /** * @function * @memberof MindElixir diff --git a/src/mouse.ts b/src/mouse.ts index d06b278b..1878d557 100644 --- a/src/mouse.ts +++ b/src/mouse.ts @@ -24,10 +24,10 @@ export default function (mind: MindElixirInstance) { const target = e.target as any if (target.tagName === 'ME-EPD') { mind.expandNode((target as Expander).previousSibling) - } else if (!mind.editable) { - return } else if (isTopic(target)) { mind.selectNode(target, false, e) + } else if (!mind.editable) { + return } else if (target.tagName === 'text') { if (target.dataset.type === 'custom-link') { mind.selectArrow(target.parentElement as CustomSvg)