Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
0b2969f8
Commit
0b2969f8
authored
Jan 07, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DEV
parent
095bff41
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
22 deletions
+2
-22
layout.js
src/module/layout.js
+2
-22
No files found.
src/module/layout.js
View file @
0b2969f8
...
@@ -33,29 +33,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -33,29 +33,9 @@ KityMinder.registerModule( "LayoutModule", function () {
var
layer
=
parent
.
getData
(
"layer"
)
+
1
;
var
layer
=
parent
.
getData
(
"layer"
)
+
1
;
var
layerArray
=
root
.
getData
(
"layer"
+
appendSide
);
var
layerArray
=
root
.
getData
(
"layer"
+
appendSide
);
layerArray
[
layer
]
=
layerArray
[
layer
]
||
[];
layerArray
[
layer
]
=
layerArray
[
layer
]
||
[];
//layerArray[ layer ].push( _node );
var
layerData
=
layerArray
[
layer
];
var
layerData
=
layerArray
[
layer
];
var
indexMin
=
layerData
[
0
]
?
layerData
[
0
].
getParent
().
getIndex
()
:
0
;
var
insertPos
=
0
;
var
indexMax
=
layerData
[
layerData
.
length
-
1
]
?
layerData
[
layerData
.
length
-
1
].
getParent
().
getIndex
()
:
0
;
var
indexNode
=
_node
.
getParent
().
getIndex
();
var
insertPos
;
if
(
indexNode
>=
indexMax
)
{
insertPos
=
layerData
.
length
;
}
else
if
(
indexNode
<
indexMin
)
{
insertPos
=
0
;
}
else
{
insertPos
=
(
function
()
{
var
pos
=
0
;
for
(
var
l
=
layerData
.
length
-
1
;
l
>=
0
;
l
--
)
{
pos
=
l
;
if
(
indexNode
===
layerData
[
l
].
getParent
().
getIndex
()
)
{
break
;
}
}
return
pos
+
1
;
}
)();
}
layerData
.
splice
(
insertPos
,
0
,
_node
);
layerData
.
splice
(
insertPos
,
0
,
_node
);
_node
.
setData
(
"layer"
,
layer
);
_node
.
setData
(
"layer"
,
layer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment