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
edf896fe
Commit
edf896fe
authored
Feb 12, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
框选删除
parent
47a399be
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
+28
-17
layout.default.js
src/module/layout.default.js
+28
-17
No files found.
src/module/layout.default.js
View file @
edf896fe
...
...
@@ -498,24 +498,35 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
appendChildNode
(
parent
,
node
,
sibling
);
},
removeNode
:
function
(
nodes
)
{
for
(
var
i
=
0
;
i
<
nodes
.
length
;
i
++
)
{
minder
.
handelNodeRemove
(
nodes
[
i
]
);
var
nodeLayout
=
nodes
[
i
].
getData
(
"layout"
);
nodeLayout
.
connect
.
remove
();
nodeLayout
.
shicon
.
remove
();
var
parent
=
nodes
[
i
].
getParent
();
if
(
parent
)
{
parent
.
removeChild
(
nodes
[
i
]
);
if
(
parent
.
getType
()
===
"root"
)
{
var
sideList
=
parent
.
getData
(
"layout"
)[
nodeLayout
.
appendside
+
"List"
];
var
idx
=
sideList
.
indexOf
(
nodes
[
i
]
);
sideList
.
splice
(
idx
,
1
);
}
var
set
=
updateLayoutVertical
(
nodes
[
i
],
parent
,
"remove"
);
for
(
var
j
=
0
;
j
<
set
.
length
;
j
++
)
{
translateNode
(
set
[
j
]
);
updateConnectAndshIcon
(
set
[
j
]
);
console
.
log
(
nodes
);
while
(
nodes
.
length
!==
0
)
{
var
_buffer
=
[
nodes
[
0
]
];
var
parent
=
nodes
[
0
].
getParent
();
var
nodeLayout
=
nodes
[
0
].
getData
(
"layout"
);
if
(
parent
.
getType
()
===
"root"
)
{
var
sideList
=
parent
.
getData
(
"layout"
)[
nodeLayout
.
appendside
+
"List"
];
var
index
=
sideList
.
indexOf
(
nodes
[
0
]
);
sideList
.
splice
(
index
,
1
);
}
var
set
=
updateLayoutVertical
(
nodes
[
0
],
parent
,
"remove"
);
for
(
var
j
=
0
;
j
<
set
.
length
;
j
++
)
{
translateNode
(
set
[
j
]
);
updateConnectAndshIcon
(
set
[
j
]
);
}
while
(
_buffer
.
length
!==
0
)
{
_buffer
=
_buffer
.
concat
(
_buffer
[
0
].
getChildren
()
);
_buffer
[
0
].
getRenderContainer
().
remove
();
var
Layout
=
_buffer
[
0
].
getData
(
"layout"
);
Layout
.
connect
.
remove
();
Layout
.
shicon
.
remove
();
var
prt
=
_buffer
[
0
].
getParent
();
prt
.
removeChild
(
_buffer
[
0
]
);
//检测当前节点是否在选中的数组中,如果在的话,从选中数组中去除
var
idx
=
nodes
.
indexOf
(
_buffer
[
0
]
);
if
(
idx
!==
-
1
)
{
nodes
.
splice
(
idx
,
1
);
}
_buffer
.
shift
();
}
}
},
...
...
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