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
853d86a6
Commit
853d86a6
authored
Feb 20, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added remove
parent
16ef799a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
1 deletion
+32
-1
layout.bottom.js
src/module/layout.bottom.js
+32
-1
No files found.
src/module/layout.bottom.js
View file @
853d86a6
...
@@ -451,7 +451,38 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -451,7 +451,38 @@ KityMinder.registerModule( "LayoutBottom", function () {
this
.
appendChildNode
(
parent
,
node
,
sibling
);
this
.
appendChildNode
(
parent
,
node
,
sibling
);
},
},
removeNode
:
function
(
nodes
)
{
removeNode
:
function
(
nodes
)
{
while
(
nodes
.
length
!==
0
)
{
var
parent
=
nodes
[
0
].
getParent
();
if
(
!
parent
)
{
nodes
.
splice
(
0
,
1
);
return
false
;
}
var
nodeLayout
=
nodes
[
0
].
getLayout
();
parent
.
removeChild
(
nodes
[
0
]
);
var
set
=
updateLayoutAll
(
nodes
[
0
],
parent
,
"remove"
);
for
(
var
j
=
0
;
j
<
set
.
length
;
j
++
)
{
translateNode
(
set
[
j
]
);
updateConnectAndshIcon
(
set
[
j
]
);
}
var
_buffer
=
[
nodes
[
0
]
];
while
(
_buffer
.
length
!==
0
)
{
_buffer
=
_buffer
.
concat
(
_buffer
[
0
].
getChildren
()
);
try
{
_buffer
[
0
].
getRenderContainer
().
remove
();
var
Layout
=
_buffer
[
0
].
getLayout
();
Layout
.
connect
.
remove
();
Layout
.
shicon
.
remove
();
}
catch
(
error
)
{
console
.
log
(
"isRemoved"
);
}
//检测当前节点是否在选中的数组中,如果在的话,从选中数组中去除
var
idx
=
nodes
.
indexOf
(
_buffer
[
0
]
);
if
(
idx
!==
-
1
)
{
nodes
.
splice
(
idx
,
1
);
}
_buffer
.
shift
();
}
}
},
},
expandNode
:
function
(
ico
)
{
expandNode
:
function
(
ico
)
{
...
...
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