Skip to content

Commit 1ab8be0

Browse files
committed
fix: unselectLink before selection
1 parent 1e55e9a commit 1ab8be0

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mind-elixir",
3-
"version": "3.2.1",
3+
"version": "3.2.2",
44
"type": "module",
55
"description": "Mind elixir is a free open source mind map core.",
66
"keywords": [

src/customLink.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ export const selectLink = function (this: MindElixirInstance, link: CustomSvg) {
175175
this.showLinkController(obj, fromData, toData)
176176
}
177177

178+
export const unselectLink = function (this: MindElixirInstance) {
179+
this.currentLink = null
180+
this.hideLinkController()
181+
}
182+
178183
export const hideLinkController = function (this: MindElixirInstance) {
179184
this.linkController.style.display = 'none'
180185
this.P2.style.display = 'none'

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ MindElixir.DARK_THEME = DARK_THEME
126126
* @memberof MindElixir
127127
* @static
128128
*/
129-
MindElixir.version = '3.2.1'
129+
MindElixir.version = '3.2.2'
130130
/**
131131
* @function
132132
* @memberof MindElixir

src/mouse.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default function (mind: MindElixirInstance) {
1616
mind.unselectNode()
1717
mind.unselectNodes()
1818
mind.unselectSummary()
19+
mind.unselectLink()
1920
// e.preventDefault() // can cause <a /> tags don't work
2021
const target = e.target as any
2122
if (target.tagName === 'ME-EPD') {

src/plugin/keypress.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ export default function (mind: MindElixirInstance) {
136136
}
137137
if (e.keyCode === 8 || e.keyCode === 46) {
138138
// del,backspace
139+
// bug
139140
if (mind.currentLink) mind.removeLink()
140141
else if (mind.currentSummary) mind.removeSummary(mind.currentSummary.summaryObj.id)
141142
else mind.removeNode()

src/plugin/selection.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export default function (mei: MindElixirInstance) {
3535
mei.unselectNode()
3636
mei.unselectNodes()
3737
mei.unselectSummary()
38+
mei.unselectLink()
3839
selection.clearSelection(true, true)
3940
}
4041
})

0 commit comments

Comments
 (0)