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
f759d12d
Commit
f759d12d
authored
Jan 09, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed updatenode bug
parent
64bd6a7c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
dev.html
demo/dev.html
+1
-0
layout.js
src/module/layout.js
+4
-5
No files found.
demo/dev.html
View file @
f759d12d
...
@@ -50,5 +50,6 @@
...
@@ -50,5 +50,6 @@
var
root
=
layerData
[
parseInt
(
Math
.
random
()
*
layerData
.
length
)]
var
root
=
layerData
[
parseInt
(
Math
.
random
()
*
layerData
.
length
)]
minder
.
execCommand
(
"createchildnode"
,
root
);
minder
.
execCommand
(
"createchildnode"
,
root
);
}
}
minder
.
execCommand
(
"updatenode"
,
_root
,{
"text"
:
"234567"
});
</script>
</script>
</html>
</html>
\ No newline at end of file
src/module/layout.js
View file @
f759d12d
KityMinder
.
registerModule
(
"LayoutModule"
,
function
()
{
KityMinder
.
registerModule
(
"LayoutModule"
,
function
()
{
var
defaultHeight
=
35
;
var
defaultHeight
=
35
;
var
isOdd
=
function
(
num
)
{
return
num
%
2
!==
0
;
};
//更新分支的高度信息
//更新分支的高度信息
var
updateBranchHeight
=
function
(
node
,
appendSide
,
root
,
isAdd
,
oldParent
)
{
var
updateBranchHeight
=
function
(
node
,
appendSide
,
root
,
isAdd
,
oldParent
)
{
var
siblings
=
(
function
()
{
var
siblings
=
(
function
()
{
...
@@ -48,9 +45,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -48,9 +45,7 @@ KityMinder.registerModule( "LayoutModule", function () {
return
true
;
return
true
;
}
}
};
};
var
updateBranchWidth
=
function
(
node
,
appendSide
)
{
};
var
reAnalyze
=
function
(
km
,
layerArray
,
appendSide
)
{
var
reAnalyze
=
function
(
km
,
layerArray
,
appendSide
)
{
for
(
var
lv
=
0
;
lv
<
layerArray
.
length
;
lv
++
)
{
for
(
var
lv
=
0
;
lv
<
layerArray
.
length
;
lv
++
)
{
var
lvData
=
layerArray
[
lv
];
var
lvData
=
layerArray
[
lv
];
...
@@ -75,6 +70,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -75,6 +70,9 @@ KityMinder.registerModule( "LayoutModule", function () {
if
(
!
parent
)
return
false
;
if
(
!
parent
)
return
false
;
var
parentX
=
parent
.
getData
(
"x"
);
var
parentX
=
parent
.
getData
(
"x"
);
var
parentWidth
=
parent
.
getRenderContainer
().
getWidth
();
var
parentWidth
=
parent
.
getRenderContainer
().
getWidth
();
if
(
parent
.
getData
(
"align"
)
===
"center"
)
{
parentWidth
=
parentWidth
/
2
;
}
var
side
=
node
.
getData
(
"appendside"
);
var
side
=
node
.
getData
(
"appendside"
);
if
(
side
===
"left"
)
{
if
(
side
===
"left"
)
{
node
.
setData
(
"x"
,
parentX
-
parentWidth
-
50
);
node
.
setData
(
"x"
,
parentX
-
parentWidth
-
50
);
...
@@ -258,6 +256,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -258,6 +256,7 @@ KityMinder.registerModule( "LayoutModule", function () {
if
(
rerender
)
{
if
(
rerender
)
{
node
.
preTraverse
(
function
(
subnode
)
{
node
.
preTraverse
(
function
(
subnode
)
{
setX
(
subnode
);
setX
(
subnode
);
console
.
log
(
subnode
);
km
.
execCommand
(
"rendernode"
,
subnode
);
km
.
execCommand
(
"rendernode"
,
subnode
);
}
);
}
);
}
else
{
}
else
{
...
...
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