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
b89df8da
Commit
b89df8da
authored
Jan 17, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed arrangement rule
parent
5768a7b8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
dev.html
demo/dev.html
+1
-0
layout.default.js
src/module/layout.default.js
+10
-5
No files found.
demo/dev.html
View file @
b89df8da
...
...
@@ -17,5 +17,6 @@
minder
=
KM
.
createMinder
(
kityminder
);
minder
.
execCommand
(
"switchlayout"
,
"default"
);
minder
.
execCommand
(
"appendchildnode"
,
new
MinderNode
());
minder
.
execCommand
(
"appendsiblingnode"
,
new
MinderNode
());
</script>
</html>
\ No newline at end of file
src/module/layout.default.js
View file @
b89df8da
...
...
@@ -140,6 +140,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
radius
:
10
,
fill
:
"skyblue"
,
stroke
:
"orange"
,
strokeWidth
:
1
,
color
:
"black"
,
padding
:
[
5
,
10
,
5
,
10
],
fontSize
:
20
,
...
...
@@ -174,6 +175,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
rect
.
fill
(
_style
.
fill
).
stroke
(
_style
.
stroke
).
setRadius
(
_style
.
radius
).
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
);
if
(
node
.
getData
(
"highlight"
)
)
{
rect
.
stroke
(
new
kity
.
Pen
(
"white"
,
3
)
);
}
else
{
rect
.
stroke
(
new
kity
.
Pen
(
_style
.
stroke
,
_style
.
strokeWidth
)
);
}
}
};
...
...
@@ -216,6 +219,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
else
shape
.
update
();
updateConnect
(
minder
,
node
);
};
//调整node的位置
var
translateNode
=
function
(
node
)
{
var
_style
=
node
.
_style
;
...
...
@@ -392,7 +396,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
}
},
appendChildNode
:
function
(
parent
,
node
)
{
appendChildNode
:
function
(
parent
,
node
,
index
)
{
var
appendside
=
parent
.
getData
(
"appendside"
);
if
(
parent
===
root
)
{
var
leftList
=
parent
.
getData
(
"leftList"
);
...
...
@@ -407,21 +411,22 @@ KityMinder.registerModule( "LayoutDefault", function () {
node
.
setData
(
"appendside"
,
appendside
);
parent
.
getData
(
appendside
+
"List"
).
push
(
node
);
}
node
.
setData
(
"appendside"
,
appendside
);
if
(
appendside
===
"left"
)
{
node
.
setData
(
"align"
,
"right"
);
}
else
{
node
.
setData
(
"align"
,
"left"
);
}
if
(
parent
.
getChildren
().
indexOf
(
node
)
===
-
1
)
parent
.
appendChild
(
node
);
if
(
parent
.
getChildren
().
indexOf
(
node
)
===
-
1
)
parent
.
appendChild
(
node
,
index
);
drawNode
(
node
);
updateArrangement
(
node
,
"append"
);
},
appendSiblingNode
:
function
(
sibling
,
node
)
{
var
parent
=
sibling
.
getParent
();
var
index
=
sibling
.
getIndex
()
+
1
;
parent
.
appendChild
(
node
,
index
);
drawNode
(
no
de
);
updateArrangement
(
node
,
"append"
);
var
appendside
=
sibling
.
getData
(
"appendside"
);
node
.
setData
(
"appendside"
,
appendsi
de
);
this
.
appendChildNode
(
parent
,
node
,
index
);
},
removeNode
:
function
(
nodes
)
{
var
root
=
this
.
getRoot
();
...
...
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