Skip to content

Commit 7dec733

Browse files
committed
fix: from and to should be string
1 parent d6f225e commit 7dec733

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/customLink.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ const createText = function (string: string, x: number, y: number, color?: strin
6767
}
6868

6969
export const createLink = function (this: MindElixirInstance, from: Topic, to: Topic, isInitPaint?: boolean, obj?: LinkItem) {
70-
const map = this.map.getBoundingClientRect()
7170
if (!from || !to) {
7271
return // not expand
7372
}
73+
this.hideLinkController()
74+
const map = this.map.getBoundingClientRect()
7475
const pfrom = from.getBoundingClientRect()
7576
const pto = to.getBoundingClientRect()
7677
const fromCenterX = (pfrom.x + pfrom.width / 2 - map.x) / this.scaleVal
@@ -177,7 +178,6 @@ export const removeLink = function (this: MindElixirInstance, linkSvg?: CustomSv
177178
link = this.currentLink
178179
}
179180
if (!link) return
180-
console.log(link)
181181
this.hideLinkController()
182182
const id = link.linkObj!.id
183183
console.log(id)

src/interact.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,6 @@ export const getDataString = function (this: MindElixirInstance) {
135135
const data = collectData(this)
136136
return JSON.stringify(data, (k, v) => {
137137
if (k === 'parent' && typeof v !== 'string') return undefined
138-
if (k === 'from') return v.nodeObj.id
139-
if (k === 'to') return v.nodeObj.id
140138
return v
141139
})
142140
}

0 commit comments

Comments
 (0)