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
d3a35581
Commit
d3a35581
authored
May 07, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recover
parent
459155f6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
23 deletions
+14
-23
layout.default.js
src/module/layout.default.js
+2
-17
layout.js
src/module/layout.js
+12
-6
No files found.
src/module/layout.default.js
View file @
d3a35581
...
...
@@ -571,13 +571,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
(
(
sub_nolimit
||
(
c
.
length
<=
expandoptions
.
defaultSubShow
)
)
&&
(
layer_nolimit
||
(
cur_layer
<=
expand_layer
)
)
)
||
_buffer
[
j
].
getLayout
().
expand
)
&&
c
.
length
!==
0
)
{
if
(
_buffer
[
j
].
getLayout
().
expand
)
{
console
.
log
(
(
(
(
(
sub_nolimit
||
(
c
.
length
<=
expandoptions
.
defaultSubShow
)
)
&&
(
layer_nolimit
||
(
cur_layer
<=
expand_layer
)
)
)
||
_buffer
[
j
].
getLayout
().
expand
)
&&
c
.
length
!==
0
)
);
}
this
.
expandNode
(
_buffer
[
j
]
);
_buffer
=
_buffer
.
concat
(
_buffer
[
j
].
getChildren
()
);
}
...
...
@@ -587,19 +580,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
sibling
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
getLayout
().
expand
===
false
)
{
minder
.
expandNode
(
parent
);
}
minder
.
handelNodeInsert
(
node
);
var
Layout
=
node
.
getLayout
();
var
oldExpand
;
if
(
Layout
)
{
oldExpand
=
Layout
.
expand
;
}
node
.
clearLayout
();
node
.
getContRc
().
clear
();
Layout
=
node
.
getLayout
();
Layout
.
expand
=
oldExpand
||
false
;
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
false
;
if
(
parent
.
getType
()
!==
'root'
)
{
parent
.
getLayout
().
expand
=
true
;
}
...
...
src/module/layout.js
View file @
d3a35581
KityMinder
.
registerModule
(
"LayoutModule"
,
function
()
{
var
me
=
this
;
var
clearPaper
=
function
()
{
me
.
_rc
.
remove
();
me
.
_rc
=
new
kity
.
Group
();
me
.
_paper
.
addShape
(
this
.
_rc
);
};
kity
.
extendClass
(
Minder
,
{
addLayoutStyle
:
function
(
name
,
style
)
{
if
(
!
this
.
_layoutStyles
)
this
.
_layoutStyles
=
{};
...
...
@@ -40,16 +46,16 @@ KityMinder.registerModule( "LayoutModule", function () {
var
_root
=
this
.
getRoot
();
_root
.
preTraverse
(
function
(
n
)
{
var
oldExpand
;
if
(
n
.
getLayout
()
)
{
oldExpand
=
n
.
getLayout
().
expand
;
}
n
.
clearLayout
();
n
.
getLayout
().
expand
=
oldExpand
;
}
);
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
,
expandall
);
this
.
fire
(
'afterinitstyle'
);
},
restoreStyle
:
function
()
{
var
curStyle
=
this
.
getCurrentStyle
();
clearPaper
();
var
_root
=
this
.
getRoot
();
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
appendChildNode
.
call
(
this
,
parent
,
node
,
focus
,
index
);
...
...
@@ -120,7 +126,7 @@ KityMinder.registerModule( "LayoutModule", function () {
if
(
!
parent
)
{
return
null
;
}
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Data
(
"expand"
)
===
false
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Layout
().
expand
===
false
)
{
km
.
expandNode
(
parent
);
}
...
...
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