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
992445b9
Commit
992445b9
authored
Feb 20, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
afe603ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
16 deletions
+7
-16
layout.bottom.js
src/module/layout.bottom.js
+2
-2
layout.js
src/module/layout.js
+5
-14
No files found.
src/module/layout.bottom.js
View file @
992445b9
...
@@ -176,6 +176,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -176,6 +176,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
nodeType
=
node
.
getType
();
var
nodeType
=
node
.
getType
();
var
Layout
=
node
.
getLayout
();
var
Layout
=
node
.
getLayout
();
var
_root
=
minder
.
getRoot
();
var
_root
=
minder
.
getRoot
();
var
mainnodes
=
_root
.
getChildren
();
var
countMainWidth
=
function
(
node
)
{
var
countMainWidth
=
function
(
node
)
{
var
nLayout
=
node
.
getLayout
();
var
nLayout
=
node
.
getLayout
();
var
selfwidth
=
node
.
getRenderContainer
().
getWidth
()
+
nodeStyles
.
main
.
margin
[
1
]
+
nodeStyles
.
main
.
margin
[
3
];
var
selfwidth
=
node
.
getRenderContainer
().
getWidth
()
+
nodeStyles
.
main
.
margin
[
1
]
+
nodeStyles
.
main
.
margin
[
3
];
...
@@ -199,7 +200,6 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -199,7 +200,6 @@ KityMinder.registerModule( "LayoutBottom", function () {
effectSet
=
effectSet
.
concat
(
children
);
effectSet
=
effectSet
.
concat
(
children
);
}
else
if
(
nodeType
===
"main"
)
{
}
else
if
(
nodeType
===
"main"
)
{
Layout
.
align
=
"center"
;
Layout
.
align
=
"center"
;
var
mainnodes
=
_root
.
getChildren
();
var
rootLayout
=
_root
.
getLayout
();
var
rootLayout
=
_root
.
getLayout
();
var
rootbranchwidth
=
0
;
var
rootbranchwidth
=
0
;
for
(
var
j
=
0
;
j
<
mainnodes
.
length
;
j
++
)
{
for
(
var
j
=
0
;
j
<
mainnodes
.
length
;
j
++
)
{
...
@@ -243,7 +243,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -243,7 +243,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
}
//自顶向下更新y
//自顶向下更新y
var
idx
=
prt
.
getIndex
();
var
idx
=
prt
.
getIndex
();
effectSet
=
[
node
];
}
}
return
effectSet
;
return
effectSet
;
};
};
...
...
src/module/layout.js
View file @
992445b9
...
@@ -98,9 +98,6 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -98,9 +98,6 @@ KityMinder.registerModule( "LayoutModule", function () {
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
)
{
var
parent
=
km
.
getSelectedNode
();
var
parent
=
km
.
getSelectedNode
();
if
(
!
parent
)
{
return
false
;
}
km
.
appendChildNode
(
parent
,
node
);
km
.
appendChildNode
(
parent
,
node
);
km
.
select
(
node
,
true
);
km
.
select
(
node
,
true
);
return
node
;
return
node
;
...
@@ -120,9 +117,6 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -120,9 +117,6 @@ KityMinder.registerModule( "LayoutModule", function () {
base
:
Command
,
base
:
Command
,
execute
:
function
(
km
,
node
)
{
execute
:
function
(
km
,
node
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNode
=
km
.
getSelectedNode
();
if
(
!
selectedNode
)
{
return
false
;
}
if
(
selectedNode
.
isRoot
()
)
{
if
(
selectedNode
.
isRoot
()
)
{
node
.
setType
(
"main"
);
node
.
setType
(
"main"
);
km
.
appendChildNode
(
selectedNode
,
node
);
km
.
appendChildNode
(
selectedNode
,
node
);
...
@@ -134,8 +128,9 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -134,8 +128,9 @@ KityMinder.registerModule( "LayoutModule", function () {
return
node
;
return
node
;
},
},
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNodes
=
km
.
getSelectedNodes
();
if
(
!
selectedNode
||
selectedNode
===
km
.
getRoot
()
)
{
//没选中节点和单选root的时候返回不可执行
if
(
selectedNodes
.
length
===
0
||
(
selectedNodes
.
length
===
1
&&
selectedNodes
[
0
]
===
km
.
getRoot
()
)
)
{
return
-
1
;
return
-
1
;
}
else
{
}
else
{
return
0
;
return
0
;
...
@@ -149,10 +144,6 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -149,10 +144,6 @@ KityMinder.registerModule( "LayoutModule", function () {
execute
:
function
(
km
)
{
execute
:
function
(
km
)
{
var
selectedNodes
=
km
.
getSelectedNodes
();
var
selectedNodes
=
km
.
getSelectedNodes
();
var
_root
=
km
.
getRoot
();
var
_root
=
km
.
getRoot
();
if
(
selectedNodes
.
length
===
0
||
(
selectedNodes
.
length
===
1
&&
!
selectedNodes
[
0
].
getParent
()
)
)
{
km
.
select
(
_root
);
return
false
;
}
var
_buffer
=
[];
var
_buffer
=
[];
for
(
var
i
=
0
;
i
<
selectedNodes
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
selectedNodes
.
length
;
i
++
)
{
_buffer
.
push
(
selectedNodes
[
i
]
);
_buffer
.
push
(
selectedNodes
[
i
]
);
...
@@ -167,7 +158,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -167,7 +158,7 @@ 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
===
0
||
(
selectedNodes
.
length
===
1
&&
selectedNodes
[
0
]
===
km
.
getRoot
()
)
)
{
return
-
1
;
return
-
1
;
}
else
{
}
else
{
return
0
;
return
0
;
...
@@ -205,7 +196,7 @@ KityMinder.registerModule( "LayoutModule", function () {
...
@@ -205,7 +196,7 @@ KityMinder.registerModule( "LayoutModule", function () {
}
}
},
},
"defaultOptions"
:
{
"defaultOptions"
:
{
"defaultlayoutstyle"
:
"
default
"
,
"defaultlayoutstyle"
:
"
bottom
"
,
"node"
:
{
"node"
:
{
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendsiblingnode'
:
'appendsiblingnode'
,
'appendchildnode'
:
'appendchildnode'
,
'appendchildnode'
:
'appendchildnode'
,
...
...
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