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
4c0db9f7
Commit
4c0db9f7
authored
Feb 20, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug
parent
ddd06b24
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
19 deletions
+38
-19
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
+12
-12
No files found.
src/module/layout.bottom.js
View file @
4c0db9f7
...
@@ -182,6 +182,9 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -182,6 +182,9 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
childwidth
=
Layout
.
subgroup
.
getWidth
()
+
nodeStyles
.
sub
.
margin
[
3
];
var
childwidth
=
Layout
.
subgroup
.
getWidth
()
+
nodeStyles
.
sub
.
margin
[
3
];
var
branchwidth
=
nLayout
.
branchwidth
=
(
selfwidth
>
childwidth
?
selfwidth
:
childwidth
);
var
branchwidth
=
nLayout
.
branchwidth
=
(
selfwidth
>
childwidth
?
selfwidth
:
childwidth
);
return
branchwidth
;
return
branchwidth
;
};
var
updateMain
=
function
(
node
)
{
};
};
if
(
nodeType
===
"root"
)
{
if
(
nodeType
===
"root"
)
{
Layout
.
x
=
getMinderSize
().
width
/
2
;
Layout
.
x
=
getMinderSize
().
width
/
2
;
...
@@ -216,13 +219,30 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -216,13 +219,30 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
else
{
}
else
{
Layout
.
align
=
"left"
;
Layout
.
align
=
"left"
;
var
parentLayout
=
parent
.
getLayout
();
var
parentLayout
=
parent
.
getLayout
();
if
(
parent
.
getType
()
===
"main"
)
{
if
(
action
===
"append"
)
{
Layout
.
x
=
10
;
if
(
parent
.
getType
()
===
"main"
)
{
Layout
.
y
=
nodeStyles
.
sub
.
margin
[
0
];
Layout
.
x
=
10
;
}
else
{
}
else
{
Layout
.
x
=
parentLayout
.
x
+
10
;
Layout
.
x
=
parentLayout
.
x
+
10
;
Layout
.
y
=
parentLayout
.
y
+
parent
.
getRenderContainer
().
getHeight
()
+
nodeStyles
.
sub
.
margin
[
0
];
}
}
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
];
effectSet
=
[
node
];
}
}
return
effectSet
;
return
effectSet
;
...
...
src/module/layout.default.js
View file @
4c0db9f7
...
@@ -605,7 +605,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -605,7 +605,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
parent
=
_buffer
[
0
].
getParent
();
var
parent
=
_buffer
[
0
].
getParent
();
Layout
.
parent
=
parent
;
Layout
.
parent
=
parent
;
_cleanbuffer
.
push
(
_buffer
[
0
]
);
_cleanbuffer
.
push
(
_buffer
[
0
]
);
//minder.appendChildNode( parent, _buffer[ 0 ] );
Layout
.
connect
=
null
;
Layout
.
connect
=
null
;
Layout
.
shicon
=
null
;
Layout
.
shicon
=
null
;
}
else
{
}
else
{
...
...
src/module/layout.js
View file @
4c0db9f7
...
@@ -108,9 +108,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -108,9 +108,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
)
{
if
(
!
selectedNode
)
{
return
false
;
return
-
1
;
}
else
{
}
else
{
return
true
;
return
0
;
}
}
}
}
};
};
...
@@ -136,9 +136,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -136,9 +136,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
||
selectedNode
===
km
.
getRoot
()
)
{
if
(
!
selectedNode
||
selectedNode
===
km
.
getRoot
()
)
{
return
false
;
return
-
1
;
}
else
{
}
else
{
return
true
;
return
0
;
}
}
}
}
};
};
...
@@ -168,9 +168,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -168,9 +168,9 @@ KityMinder.registerModule( "LayoutModule", function () {
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNodes
=
km
.
getSelectedNodes
();
var
selectedNodes
=
km
.
getSelectedNodes
();
if
(
(
selectedNodes
.
length
===
1
&&
selectedNodes
[
0
]
===
km
.
getRoot
()
)
||
selectedNodes
.
length
===
0
)
{
if
(
(
selectedNodes
.
length
===
1
&&
selectedNodes
[
0
]
===
km
.
getRoot
()
)
||
selectedNodes
.
length
===
0
)
{
return
false
;
return
-
1
;
}
else
{
}
else
{
return
true
;
return
0
;
}
}
}
}
};
};
...
@@ -205,12 +205,12 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -205,12 +205,12 @@ KityMinder.registerModule( "LayoutModule", function () {
}
}
},
},
"defaultOptions"
:
{
"defaultOptions"
:
{
"defaultlayoutstyle"
:
"
default
"
,
"defaultlayoutstyle"
:
"
bottom
"
,
"node"
:
{
"node"
:
{
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendchildnode'
:
'appendchildnode'
,
'appendchildnode'
:
'appendchildnode'
,
'removenode'
:
'removenode'
'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