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 @@
...
@@ -17,5 +17,6 @@
minder
=
KM
.
createMinder
(
kityminder
);
minder
=
KM
.
createMinder
(
kityminder
);
minder
.
execCommand
(
"switchlayout"
,
"default"
);
minder
.
execCommand
(
"switchlayout"
,
"default"
);
minder
.
execCommand
(
"appendchildnode"
,
new
MinderNode
());
minder
.
execCommand
(
"appendchildnode"
,
new
MinderNode
());
minder
.
execCommand
(
"appendsiblingnode"
,
new
MinderNode
());
</script>
</script>
</html>
</html>
\ No newline at end of file
src/module/layout.default.js
View file @
b89df8da
...
@@ -140,6 +140,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -140,6 +140,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
radius
:
10
,
radius
:
10
,
fill
:
"skyblue"
,
fill
:
"skyblue"
,
stroke
:
"orange"
,
stroke
:
"orange"
,
strokeWidth
:
1
,
color
:
"black"
,
color
:
"black"
,
padding
:
[
5
,
10
,
5
,
10
],
padding
:
[
5
,
10
,
5
,
10
],
fontSize
:
20
,
fontSize
:
20
,
...
@@ -174,6 +175,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -174,6 +175,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
rect
.
fill
(
_style
.
fill
).
stroke
(
_style
.
stroke
).
setRadius
(
_style
.
radius
).
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
);
rect
.
fill
(
_style
.
fill
).
stroke
(
_style
.
stroke
).
setRadius
(
_style
.
radius
).
setWidth
(
_rectWidth
).
setHeight
(
_rectHeight
);
if
(
node
.
getData
(
"highlight"
)
)
{
if
(
node
.
getData
(
"highlight"
)
)
{
rect
.
stroke
(
new
kity
.
Pen
(
"white"
,
3
)
);
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 () {
...
@@ -216,6 +219,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
else
shape
.
update
();
else
shape
.
update
();
updateConnect
(
minder
,
node
);
updateConnect
(
minder
,
node
);
};
};
//调整node的位置
//调整node的位置
var
translateNode
=
function
(
node
)
{
var
translateNode
=
function
(
node
)
{
var
_style
=
node
.
_style
;
var
_style
=
node
.
_style
;
...
@@ -392,7 +396,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -392,7 +396,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
}
}
}
},
},
appendChildNode
:
function
(
parent
,
node
)
{
appendChildNode
:
function
(
parent
,
node
,
index
)
{
var
appendside
=
parent
.
getData
(
"appendside"
);
var
appendside
=
parent
.
getData
(
"appendside"
);
if
(
parent
===
root
)
{
if
(
parent
===
root
)
{
var
leftList
=
parent
.
getData
(
"leftList"
);
var
leftList
=
parent
.
getData
(
"leftList"
);
...
@@ -407,21 +411,22 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -407,21 +411,22 @@ KityMinder.registerModule( "LayoutDefault", function () {
node
.
setData
(
"appendside"
,
appendside
);
node
.
setData
(
"appendside"
,
appendside
);
parent
.
getData
(
appendside
+
"List"
).
push
(
node
);
parent
.
getData
(
appendside
+
"List"
).
push
(
node
);
}
}
node
.
setData
(
"appendside"
,
appendside
);
if
(
appendside
===
"left"
)
{
if
(
appendside
===
"left"
)
{
node
.
setData
(
"align"
,
"right"
);
node
.
setData
(
"align"
,
"right"
);
}
else
{
}
else
{
node
.
setData
(
"align"
,
"left"
);
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
);
drawNode
(
node
);
updateArrangement
(
node
,
"append"
);
updateArrangement
(
node
,
"append"
);
},
},
appendSiblingNode
:
function
(
sibling
,
node
)
{
appendSiblingNode
:
function
(
sibling
,
node
)
{
var
parent
=
sibling
.
getParent
();
var
parent
=
sibling
.
getParent
();
var
index
=
sibling
.
getIndex
()
+
1
;
var
index
=
sibling
.
getIndex
()
+
1
;
parent
.
appendChild
(
node
,
index
);
var
appendside
=
sibling
.
getData
(
"appendside"
);
drawNode
(
no
de
);
node
.
setData
(
"appendside"
,
appendsi
de
);
updateArrangement
(
node
,
"append"
);
this
.
appendChildNode
(
parent
,
node
,
index
);
},
},
removeNode
:
function
(
nodes
)
{
removeNode
:
function
(
nodes
)
{
var
root
=
this
.
getRoot
();
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