Skip to content

Commit 69afe8f

Browse files
committed
fix: v3.0.2, fix refresh() error
fixed #216
1 parent d75b5c6 commit 69afe8f

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
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.0.1",
3+
"version": "3.0.2",
44
"type": "module",
55
"description": "Mind elixir is a free open source mind map core.",
66
"keywords": [

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ MindElixir.DARK_THEME = DARK_THEME
130130
* @memberof MindElixir
131131
* @static
132132
*/
133-
MindElixir.version = '3.0.1'
133+
MindElixir.version = '3.0.2'
134134
/**
135135
* @function
136136
* @memberof MindElixir

src/interact.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ export const expandNode = function (this: MindElixirInstance, el: Topic, isExpan
319319
* @param {TargetElement} data mind elixir data
320320
*/
321321
export const refresh = function (this: MindElixirInstance, data?: MindElixirData) {
322-
data = JSON.parse(JSON.stringify(data)) // it shouldn't contanimate the original data
323-
// add parent property to every node
324322
if (data) {
323+
data = JSON.parse(JSON.stringify(data)) as MindElixirData // it shouldn't contanimate the original data
325324
this.nodeData = data.nodeData
326325
this.linkData = data.linkData || {}
327326
}

src/utils/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export const getObjById = function (id: string, data: NodeObj): NodeObj | null {
2121
}
2222
}
2323

24+
/**
25+
* Add parent property to every node
26+
*/
2427
export const fillParent = (data: NodeObj, parent?: NodeObj) => {
2528
data.parent = parent
2629
if (data.children) {

0 commit comments

Comments
 (0)