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
1c9507bf
Commit
1c9507bf
authored
May 06, 2014
by
Ronny
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
dda8fc15
666cf9cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
12 deletions
+29
-12
kityminder.config.js
kityminder.config.js
+1
-1
layout.default.js
src/module/layout.default.js
+28
-11
No files found.
kityminder.config.js
View file @
1c9507bf
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
//默认是全部展开,0表示全部展开
//默认是全部展开,0表示全部展开
,
,
defaultExpand
:
{
defaultExpand
:
{
defaultLayer
:
2
,
defaultLayer
:
1
,
defaultSubShow
:
5
defaultSubShow
:
5
}
}
};
};
...
...
src/module/layout.default.js
View file @
1c9507bf
...
@@ -493,7 +493,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -493,7 +493,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
node
:
node
node
:
node
},
false
)
);
},
false
)
);
this
.
_firePharse
(
new
MinderEvent
(
"RenderNode"
,
{
node
:
node
},
false
)
);
updateShapeByCont
(
node
);
updateShapeByCont
(
node
);
var
set1
=
updateLayoutHorizon
(
node
);
var
set1
=
updateLayoutHorizon
(
node
);
var
set2
=
updateLayoutVertical
(
node
,
node
.
getParent
(),
"change"
);
var
set2
=
updateLayoutVertical
(
node
,
node
.
getParent
(),
"change"
);
...
@@ -531,6 +533,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -531,6 +533,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
node
:
_root
node
:
_root
},
false
)
);
},
false
)
);
this
.
_firePharse
(
new
MinderEvent
(
"RenderNode"
,
{
node
:
node
},
false
)
);
updateShapeByCont
(
_root
);
updateShapeByCont
(
_root
);
updateLayoutHorizon
(
_root
);
updateLayoutHorizon
(
_root
);
updateLayoutVertical
(
_root
);
updateLayoutVertical
(
_root
);
...
@@ -544,26 +549,29 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -544,26 +549,29 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
appendChildNode
(
_root
,
mains
[
i
]
);
this
.
appendChildNode
(
_root
,
mains
[
i
]
);
}
}
cur_layer
++
;
cur_layer
++
;
//创建一级节点的副本
var
clonelayer0
=
function
()
{
var
_buffer
=
(
function
()
{
var
items
=
[];
var
items
=
[];
for
(
var
i
=
0
;
i
<
mains
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
mains
.
length
;
i
++
)
{
items
.
push
(
mains
[
i
]
);
items
.
push
(
mains
[
i
]
);
}
}
return
items
;
return
items
;
}
)();
};
//创建一级节点的副本
var
_buffer
=
clonelayer0
();
next
=
[];
next
=
[];
var
layer_nolimit
=
expandall
||
(
expand_layer
<
1
)
||
false
;
var
layer_nolimit
=
expandall
||
(
expand_layer
<
1
)
||
false
;
var
sub_nolimit
=
expandall
||
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
sub_nolimit
=
expandall
||
(
expandoptions
.
defaultSubShow
<
1
)
||
false
;
var
loopcontinue
=
function
()
{
return
(
layer_nolimit
?
(
_buffer
.
length
!==
0
)
:
(
_buffer
.
length
!==
0
&&
cur_layer
<
expand_layer
)
);
while
(
_buffer
.
length
!==
0
)
{
};
while
(
loopcontinue
()
)
{
cur_layer
++
;
cur_layer
++
;
var
layer_len
=
_buffer
.
length
;
var
layer_len
=
_buffer
.
length
;
for
(
var
j
=
0
;
j
<
layer_len
;
j
++
)
{
for
(
var
j
=
0
;
j
<
layer_len
;
j
++
)
{
var
c
=
_buffer
[
j
].
getChildren
();
var
c
=
_buffer
[
j
].
getChildren
();
if
(
(
sub_nolimit
||
(
c
.
length
<=
expandoptions
.
defaultSubShow
)
)
&&
c
.
length
!==
0
)
{
if
(
(
(
(
sub_nolimit
||
(
c
.
length
<=
expandoptions
.
defaultSubShow
)
)
&&
(
cur_layer
<=
expand_layer
)
)
||
_buffer
[
j
].
getLayout
().
expand
)
&&
c
.
length
!==
0
)
{
this
.
expandNode
(
_buffer
[
j
]
);
this
.
expandNode
(
_buffer
[
j
]
);
_buffer
=
_buffer
.
concat
(
_buffer
[
j
].
getChildren
()
);
_buffer
=
_buffer
.
concat
(
_buffer
[
j
].
getChildren
()
);
}
}
...
@@ -577,10 +585,16 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -577,10 +585,16 @@ KityMinder.registerModule( "LayoutDefault", function () {
minder
.
expandNode
(
parent
);
minder
.
expandNode
(
parent
);
}
}
minder
.
handelNodeInsert
(
node
);
minder
.
handelNodeInsert
(
node
);
var
Layout
=
node
.
getLayout
();
var
oldExpand
;
if
(
Layout
)
{
oldExpand
=
Layout
.
expand
;
}
node
.
clearLayout
();
node
.
clearLayout
();
node
.
getContRc
().
clear
();
node
.
getContRc
().
clear
();
var
Layout
=
node
.
getLayout
();
Layout
=
node
.
getLayout
();
Layout
.
expand
=
false
;
Layout
.
expand
=
oldExpand
||
false
;
console
.
log
(
oldExpand
);
if
(
parent
.
getType
()
!==
'root'
)
{
if
(
parent
.
getType
()
!==
'root'
)
{
parent
.
getLayout
().
expand
=
true
;
parent
.
getLayout
().
expand
=
true
;
}
}
...
@@ -669,6 +683,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -669,6 +683,9 @@ KityMinder.registerModule( "LayoutDefault", function () {
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
this
.
_firePharse
(
new
MinderEvent
(
"RenderNodeTop"
,
{
node
:
node
node
:
node
},
false
)
);
},
false
)
);
this
.
_firePharse
(
new
MinderEvent
(
"RenderNode"
,
{
node
:
node
},
false
)
);
updateShapeByCont
(
node
);
updateShapeByCont
(
node
);
var
set1
=
updateLayoutVertical
(
node
,
parent
,
"append"
);
var
set1
=
updateLayoutVertical
(
node
,
parent
,
"append"
);
var
set2
=
updateLayoutHorizon
(
node
);
var
set2
=
updateLayoutHorizon
(
node
);
...
...
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