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
ac919779
Commit
ac919779
authored
Jan 20, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了layout相关的字段,样式切换的时候统一清空“layout字段”
parent
14fba533
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
684 additions
and
140 deletions
+684
-140
layout.default.js
src/module/layout.default.js
+85
-60
layout.green.backup.js
src/module/layout.green.backup.js
+373
-0
layout.green.js
src/module/layout.green.js
+199
-76
layout.js
src/module/layout.js
+27
-4
No files found.
src/module/layout.default.js
View file @
ac919779
This diff is collapsed.
Click to expand it.
src/module/layout.green.backup.js
0 → 100644
View file @
ac919779
This diff is collapsed.
Click to expand it.
src/module/layout.green.js
View file @
ac919779
This diff is collapsed.
Click to expand it.
src/module/layout.js
View file @
ac919779
KityMinder
.
registerModule
(
"LayoutModule"
,
function
()
{
kity
.
extendClass
(
MinderNode
,
{
setLayout
:
function
(
k
,
v
)
{
if
(
this
.
setData
(
'layout'
)
===
undefined
)
{
this
.
setData
(
'layout'
,
{}
);
}
var
_pros
=
this
.
getLayout
();
Utils
.
extend
(
_pros
,
{
k
:
v
}
);
this
.
setData
(
'layout'
,
_pros
);
},
getLayout
:
function
(
k
)
{
if
(
k
===
undefined
)
{
return
this
.
getData
(
'layout'
);
}
return
this
.
getData
(
'layout'
)[
k
];
},
clearLayout
:
function
()
{
this
.
setData
(
'layout'
,
{}
);
this
.
getRenderContainer
().
clear
();
},
updateLayout
:
function
(
km
)
{
km
.
updateLayout
(
this
);
}
}
);
var
switchLayout
=
function
(
km
,
style
)
{
var
_style
=
km
.
getLayoutStyle
(
style
);
if
(
!
_style
)
return
false
;
...
...
@@ -7,13 +32,11 @@ KityMinder.registerModule( "LayoutModule", function () {
km
.
appendChildNode
=
_style
.
appendChildNode
;
km
.
appendSiblingNode
=
_style
.
appendSiblingNode
;
km
.
removeNode
=
_style
.
removeNode
;
km
.
updateLayout
=
_style
.
updateLayout
;
//清空节点上附加的数据
var
_root
=
km
.
getRoot
();
_root
.
preTraverse
(
function
(
node
)
{
node
.
setData
(
"style"
,
{}
);
node
.
setData
(
"shape"
,
null
);
node
.
getRenderContainer
().
clear
();
node
.
clearLayout
();
}
);
km
.
initStyle
();
return
style
;
...
...
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