Skip to content

Commit b94c440

Browse files
committed
fix: fix wrong display when direction === 0
1 parent ad15ab8 commit b94c440

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
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": "0.16.4",
3+
"version": "0.16.5",
44
"description": "Mind elixir is a free open source mind map core.",
55
"main": "dist/MindElixir.js",
66
"scripts": {

src/utils/dom.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export function createInputDiv(tpc) {
103103
div.addEventListener('keydown', e => {
104104
e.stopPropagation()
105105
let key = e.keyCode
106-
console.log(e,key)
106+
console.log(e, key)
107107
if (key === 8) {
108108
// 不停止冒泡冒到 document 就把节点删了
109109
// e.stopPropagation()
@@ -164,17 +164,15 @@ export function createChildren(data, container, direction) {
164164
for (let i = 0; i < data.length; i++) {
165165
let nodeObj = data[i]
166166
let grp = $d.createElement('GRP')
167-
if (direction) {
168-
if (direction === LEFT) {
167+
if (direction === LEFT) {
168+
grp.className = 'lhs'
169+
} else if (direction === RIGHT) {
170+
grp.className = 'rhs'
171+
} else if (direction === SIDE) {
172+
if (nodeObj.direction === LEFT) {
169173
grp.className = 'lhs'
170-
} else if (direction === RIGHT) {
174+
} else if (nodeObj.direction === RIGHT) {
171175
grp.className = 'rhs'
172-
} else if (direction === SIDE) {
173-
if (nodeObj.direction === LEFT) {
174-
grp.className = 'lhs'
175-
} else if (nodeObj.direction === RIGHT) {
176-
grp.className = 'rhs'
177-
}
178176
}
179177
}
180178
let top = createTop(nodeObj)

0 commit comments

Comments
 (0)