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
b9015627
Commit
b9015627
authored
Jun 24, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加局部 layout 更新的方法
parent
e4f05e9b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
26 additions
and
7 deletions
+26
-7
index.html
index.html
+1
-0
layout.js
src/core/layout.js
+7
-5
node.js
src/core/node.js
+8
-0
render.js
src/core/render.js
+4
-0
expand.js
src/module/expand.js
+5
-1
node.js
src/module/node.js
+1
-1
No files found.
index.html
View file @
b9015627
...
@@ -58,6 +58,7 @@
...
@@ -58,6 +58,7 @@
<a
href=
"https://github.com/fex-team/kityminder/issues/new"
target=
"_blank"
>
Bug
</a>
|
<a
href=
"https://github.com/fex-team/kityminder/issues/new"
target=
"_blank"
>
Bug
</a>
|
<a
href=
"mailto:kity@baidu.com"
target=
"_blank"
>
Contact Us
</a>
<a
href=
"mailto:kity@baidu.com"
target=
"_blank"
>
Contact Us
</a>
</p>
</p>
<script>
window
.
_bd_share_config
=
{
"common"
:{
"bdSnsKey"
:{},
"bdMini"
:
"2"
,
"bdMiniList"
:[],
"bdPic"
:
""
,
"bdStyle"
:
"1"
,
"bdSize"
:
"32"
},
"share"
:{}};
with
(
document
)
0
[(
getElementsByTagName
(
'head'
)[
0
]
||
body
).
appendChild
(
createElement
(
'script'
)).
src
=
'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='
+~
(
-
new
Date
()
/
36
e5
)];
</script>
</body>
</body>
<script>
<script>
// create km instance
// create km instance
...
...
src/core/layout.js
View file @
b9015627
...
@@ -128,7 +128,7 @@ kity.extendClass(MinderNode, {
...
@@ -128,7 +128,7 @@ kity.extendClass(MinderNode, {
}
}
}
}
this
.
getMinder
().
layout
(
duration
);
this
.
getMinder
().
layout
(
this
,
duration
);
return
this
;
return
this
;
},
},
...
@@ -140,9 +140,11 @@ kity.extendClass(MinderNode, {
...
@@ -140,9 +140,11 @@ kity.extendClass(MinderNode, {
kity
.
extendClass
(
Minder
,
{
kity
.
extendClass
(
Minder
,
{
layout
:
function
(
duration
)
{
layout
:
function
(
root
,
duration
)
{
this
.
getRoot
().
traverse
(
function
(
node
)
{
root
=
root
||
this
.
getRoot
();
root
.
traverse
(
function
(
node
)
{
node
.
setLayoutTransform
(
null
);
node
.
setLayoutTransform
(
null
);
});
});
...
@@ -160,9 +162,9 @@ kity.extendClass(Minder, {
...
@@ -160,9 +162,9 @@ kity.extendClass(Minder, {
layout
.
doLayout
(
node
);
layout
.
doLayout
(
node
);
}
}
layoutNode
(
this
.
getRoot
()
);
layoutNode
(
root
);
this
.
applyLayoutResult
(
this
.
getRoot
()
,
duration
);
this
.
applyLayoutResult
(
root
,
duration
);
return
this
.
fire
(
'layout'
);
return
this
.
fire
(
'layout'
);
},
},
...
...
src/core/node.js
View file @
b9015627
...
@@ -64,6 +64,14 @@ var MinderNode = KityMinder.MinderNode = kity.createClass('MinderNode', {
...
@@ -64,6 +64,14 @@ var MinderNode = KityMinder.MinderNode = kity.createClass('MinderNode', {
return
level
;
return
level
;
},
},
/**
* 获得节点的复杂度
* @return {[type]} [description]
*/
getComplex
:
function
()
{
},
/**
/**
* 获得节点的类型(root|main|sub)
* 获得节点的类型(root|main|sub)
*/
*/
...
...
src/core/render.js
View file @
b9015627
...
@@ -52,6 +52,10 @@ kity.extendClass(Minder, {
...
@@ -52,6 +52,10 @@ kity.extendClass(Minder, {
var
g
=
KityMinder
.
Geometry
;
var
g
=
KityMinder
.
Geometry
;
var
i
,
latestBox
,
renderer
;
var
i
,
latestBox
,
renderer
;
this
.
fire
(
'beforerender'
,
{
node
:
node
});
if
(
!
node
.
_renderers
)
{
if
(
!
node
.
_renderers
)
{
this
.
_createRendererForNode
(
node
);
this
.
_createRendererForNode
(
node
);
}
}
...
...
src/module/expand.js
View file @
b9015627
...
@@ -198,7 +198,6 @@ KityMinder.registerModule('Expand', function() {
...
@@ -198,7 +198,6 @@ KityMinder.registerModule('Expand', function() {
if
(
!
node
.
parent
)
return
;
if
(
!
node
.
parent
)
return
;
var
visible
=
node
.
parent
.
isExpanded
();
var
visible
=
node
.
parent
.
isExpanded
();
node
.
getRenderContainer
().
setVisible
(
visible
);
expander
.
setState
(
visible
&&
node
.
children
.
length
?
node
.
getData
(
EXPAND_STATE_DATA
)
:
'hide'
);
expander
.
setState
(
visible
&&
node
.
children
.
length
?
node
.
getData
(
EXPAND_STATE_DATA
)
:
'hide'
);
...
@@ -229,6 +228,11 @@ KityMinder.registerModule('Expand', function() {
...
@@ -229,6 +228,11 @@ KityMinder.registerModule('Expand', function() {
},
},
'preimport'
:
function
(
e
)
{
'preimport'
:
function
(
e
)
{
var
json
=
e
.
json
;
var
json
=
e
.
json
;
},
'beforerender'
:
function
(
e
)
{
var
node
=
e
.
node
;
var
visible
=
!
node
.
parent
||
node
.
parent
.
isExpanded
();
node
.
getRenderContainer
().
setVisible
(
visible
);
}
}
},
},
renderers
:
{
renderers
:
{
...
...
src/module/node.js
View file @
b9015627
...
@@ -30,7 +30,7 @@ var AppendSiblingCommand = kity.createClass('AppendSiblingCommand', {
...
@@ -30,7 +30,7 @@ var AppendSiblingCommand = kity.createClass('AppendSiblingCommand', {
km
.
select
(
node
,
true
);
km
.
select
(
node
,
true
);
node
.
render
();
node
.
render
();
node
.
_lastLayoutTransform
=
sibling
.
_lastLayoutTransform
;
node
.
_lastLayoutTransform
=
sibling
.
_lastLayoutTransform
;
km
.
layout
(
300
);
km
.
layout
(
300
0
);
},
},
queryState
:
function
(
km
)
{
queryState
:
function
(
km
)
{
var
selectedNode
=
km
.
getSelectedNode
();
var
selectedNode
=
km
.
getSelectedNode
();
...
...
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