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
f44593c4
Commit
f44593c4
authored
May 18, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug
parent
f0b86460
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
30 deletions
+32
-30
layout.bottom.js
src/module/layout.bottom.js
+32
-30
No files found.
src/module/layout.bottom.js
View file @
f44593c4
...
...
@@ -393,7 +393,7 @@ KityMinder.registerModule("LayoutBottom", function () {
node
:
node
},
false
));
this
.
_firePharse
(
new
MinderEvent
(
"RenderNode"
,
{
node
:
_root
node
:
node
},
false
));
updateShapeByCont
(
node
);
var
set
=
updateLayoutAll
(
node
,
node
.
getParent
(),
"change"
);
...
...
@@ -469,6 +469,7 @@ KityMinder.registerModule("LayoutBottom", function () {
Layout
=
node
.
getLayout
();
Layout
.
added
=
true
;
initLayout
(
node
);
var
parentLayout
=
parent
.
getLayout
();
//设置分支类型
if
(
parent
.
getType
()
===
"root"
)
{
node
.
setType
(
"main"
);
...
...
@@ -575,41 +576,42 @@ KityMinder.registerModule("LayoutBottom", function () {
isExpand
=
ico
.
icon
.
switchState
();
node
=
ico
.
icon
.
_node
;
}
node
.
setData
(
"expand"
,
isExpand
);
var
_buffer
=
node
.
getChildren
();
var
_cleanbuffer
=
[];
while
(
_buffer
.
length
!==
0
)
{
var
Layout
=
_buffer
[
0
].
getLayout
();
if
(
isExpand
)
{
var
parent
=
_buffer
[
0
].
getParent
();
Layout
.
parent
=
parent
;
_cleanbuffer
.
push
(
_buffer
[
0
]);
Layout
.
connect
=
null
;
Layout
.
shicon
=
null
;
}
else
{
try
{
var
_buffer
;
if
(
isExpand
)
{
node
.
expand
();
//遍历子树展开需要展开的节点
_buffer
=
[
node
];
while
(
_buffer
.
length
!==
0
)
{
var
c
=
_buffer
[
0
].
getChildren
();
if
(
_buffer
[
0
].
isExpanded
()
&&
c
.
length
!==
0
)
{
for
(
var
x
=
0
;
x
<
c
.
length
;
x
++
)
{
minder
.
appendChildNode
(
_buffer
[
0
],
c
[
x
]);
}
_buffer
=
_buffer
.
concat
(
c
);
}
_buffer
.
shift
();
}
}
else
{
node
.
collapse
();
//遍历子树移除需要移除的节点
_buffer
=
node
.
getChildren
();
while
(
_buffer
.
length
!==
0
)
{
var
Layout
=
_buffer
[
0
].
getLayout
();
if
(
Layout
.
added
)
{
Layout
.
added
=
false
;
_buffer
[
0
].
getRenderContainer
().
remove
();
Layout
.
connect
.
remove
();
if
(
Layout
.
shicon
)
Layout
.
shicon
.
remove
();
}
catch
(
error
)
{}
}
_buffer
=
_buffer
.
concat
(
_buffer
[
0
].
getChildren
());
_buffer
.
shift
();
}
_buffer
=
_buffer
.
concat
(
_buffer
[
0
].
getChildren
());
_buffer
.
shift
();
}
if
(
isExpand
)
{
node
.
clearChildren
();
for
(
var
j
=
0
;
j
<
_cleanbuffer
.
length
;
j
++
)
{
_cleanbuffer
[
j
].
clearChildren
();
minder
.
appendChildNode
(
_cleanbuffer
[
j
].
getLayout
().
parent
,
_cleanbuffer
[
j
]);
var
set
=
updateLayoutVertical
(
node
,
node
.
getParent
(),
"contract"
);
for
(
var
i
=
0
;
i
<
set
.
length
;
i
++
)
{
translateNode
(
set
[
i
]);
updateConnectAndshIcon
(
set
[
i
]);
}
}
var
set
=
[];
if
(
!
isExpand
)
set
=
updateLayoutAll
(
node
,
node
.
getParent
(),
"contract"
);
for
(
var
i
=
0
;
i
<
set
.
length
;
i
++
)
{
translateNode
(
set
[
i
]);
updateConnectAndshIcon
(
set
[
i
]);
}
}
};
this
.
addLayoutStyle
(
"bottom"
,
_style
);
...
...
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