Skip to content

Commit

Permalink
fix: set direction after moving node
Browse files Browse the repository at this point in the history
fixed #219
  • Loading branch information
SSShooter committed Nov 10, 2023
1 parent b8390f4 commit 5e29bb1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mind-elixir",
"version": "3.3.1",
"version": "3.3.2",
"type": "module",
"description": "Mind elixir is a free open source mind map core.",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -128,7 +128,7 @@ MindElixir.DARK_THEME = DARK_THEME
* @memberof MindElixir
* @static
*/
MindElixir.version = '3.3.1'
MindElixir.version = '3.3.2'
/**
* @function
* @memberof MindElixir
Expand Down
2 changes: 2 additions & 0 deletions src/utils/objectManipulation.ts
Expand Up @@ -59,12 +59,14 @@ export function moveNodeObj(from: NodeObj, to: NodeObj) {
}

export function moveNodeBeforeObj(from: NodeObj, to: NodeObj) {
if (from.direction !== undefined) from.direction = to.direction
removeNodeObj(from)
const { siblings, index } = getSibling(to)
siblings.splice(index, 0, from)
}

export function moveNodeAfterObj(from: NodeObj, to: NodeObj) {
if (from.direction !== undefined) from.direction = to.direction
removeNodeObj(from)
const { siblings, index } = getSibling(to)
siblings.splice(index + 1, 0, from)
Expand Down

0 comments on commit 5e29bb1

Please sign in to comment.