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
8a45a9ca
Commit
8a45a9ca
authored
Feb 20, 2014
by
hancong03
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of github.com:kitygraph/kityminder into dev
parents
43ee7536
afe603ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
18 deletions
+37
-18
layout.bottom.js
src/module/layout.bottom.js
+26
-6
layout.default.js
src/module/layout.default.js
+0
-1
layout.js
src/module/layout.js
+11
-11
No files found.
src/module/layout.bottom.js
View file @
8a45a9ca
...
...
@@ -182,6 +182,9 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
childwidth
=
Layout
.
subgroup
.
getWidth
()
+
nodeStyles
.
sub
.
margin
[
3
];
var
branchwidth
=
nLayout
.
branchwidth
=
(
selfwidth
>
childwidth
?
selfwidth
:
childwidth
);
return
branchwidth
;
};
var
updateMain
=
function
(
node
)
{
};
if
(
nodeType
===
"root"
)
{
Layout
.
x
=
getMinderSize
().
width
/
2
;
...
...
@@ -216,13 +219,30 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
else
{
Layout
.
align
=
"left"
;
var
parentLayout
=
parent
.
getLayout
();
if
(
parent
.
getType
()
===
"main"
)
{
Layout
.
x
=
10
;
Layout
.
y
=
nodeStyles
.
sub
.
margin
[
0
];
}
else
{
Layout
.
x
=
parentLayout
.
x
+
10
;
Layout
.
y
=
parentLayout
.
y
+
parent
.
getRenderContainer
().
getHeight
()
+
nodeStyles
.
sub
.
margin
[
0
];
if
(
action
===
"append"
)
{
if
(
parent
.
getType
()
===
"main"
)
{
Layout
.
x
=
10
;
}
else
{
Layout
.
x
=
parentLayout
.
x
+
10
;
}
}
if
(
action
===
"append"
||
action
===
"change"
)
{
Layout
.
branchheight
=
node
.
getRenderContainer
().
getHeight
()
+
nodeStyles
.
sub
.
margin
[
0
]
+
nodeStyles
.
sub
.
margin
[
2
];
}
var
prt
=
parent
;
//自底向上更新branchheight
while
(
prt
.
getType
()
!==
"main"
)
{
var
c
=
prt
.
getChildren
();
var
prtLayout
=
prt
.
getLayout
();
var
branchHeight
=
prt
.
getRenderContainer
().
getHeight
()
+
nodeStyles
.
sub
.
margin
[
0
]
+
nodeStyles
.
sub
.
margin
[
2
];
for
(
var
i1
=
0
;
i1
<
c
.
length
;
i1
++
)
{
branchHeight
+=
c
[
i1
].
getLayout
().
branchheight
;
}
prtLayout
.
branchheight
=
branchHeight
;
prt
=
prt
.
getParent
();
}
//自顶向下更新y
var
idx
=
prt
.
getIndex
();
effectSet
=
[
node
];
}
return
effectSet
;
...
...
src/module/layout.default.js
View file @
8a45a9ca
...
...
@@ -605,7 +605,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
parent
=
_buffer
[
0
].
getParent
();
Layout
.
parent
=
parent
;
_cleanbuffer
.
push
(
_buffer
[
0
]
);
//minder.appendChildNode( parent, _buffer[ 0 ] );
Layout
.
connect
=
null
;
Layout
.
shicon
=
null
;
}
else
{
...
...
src/module/layout.js
View file @
8a45a9ca
...
...
@@ -108,9 +108,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
)
{
return
false
;
return
-
1
;
}
else
{
return
true
;
return
0
;
}
}
};
...
...
@@ -136,9 +136,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
||
selectedNode
===
km
.
getRoot
()
)
{
return
false
;
return
-
1
;
}
else
{
return
true
;
return
0
;
}
}
};
...
...
@@ -168,9 +168,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
var
selectedNodes
=
km
.
getSelectedNodes
();
if
(
(
selectedNodes
.
length
===
1
&&
selectedNodes
[
0
]
===
km
.
getRoot
()
)
||
selectedNodes
.
length
===
0
)
{
return
false
;
return
-
1
;
}
else
{
return
true
;
return
0
;
}
}
};
...
...
@@ -206,11 +206,11 @@ KityMinder.registerModule( "LayoutModule", function () {
},
"defaultOptions"
:
{
"defaultlayoutstyle"
:
"default"
,
"node"
:
{
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendchildnode'
:
'appendchildnode'
,
'removenode'
:
'removenode'
}
"node"
:
{
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendchildnode'
:
'appendchildnode'
,
'removenode'
:
'removenode'
}
}
};
}
);
\ No newline at end of file
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