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
5427c7b0
Commit
5427c7b0
authored
May 07, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
be565a30
d3a35581
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
21 deletions
+15
-21
layout.default.js
src/module/layout.default.js
+2
-14
layout.js
src/module/layout.js
+13
-7
No files found.
src/module/layout.default.js
View file @
5427c7b0
...
...
@@ -510,7 +510,6 @@ KityMinder.registerModule( "LayoutDefault", function () {
},
initStyle
:
function
(
expandall
)
{
var
_root
=
minder
.
getRoot
();
//debugger;
var
historyPoint
=
_root
.
getPoint
();
if
(
historyPoint
)
historyPoint
=
JSON
.
parse
(
JSON
.
stringify
(
historyPoint
)
);
minder
.
handelNodeInsert
(
_root
);
...
...
@@ -581,22 +580,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
sibling
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
getLayout
().
expand
===
false
)
{
minder
.
expandNode
(
parent
);
}
minder
.
handelNodeInsert
(
node
);
var
Layout
=
node
.
getLayout
();
var
oldExpand
;
if
(
Layout
)
{
oldExpand
=
Layout
.
expand
;
}
if
(
oldExpand
)
{
alert
(
'aru'
);
}
node
.
clearLayout
();
node
.
getContRc
().
clear
();
Layout
=
node
.
getLayout
();
Layout
.
expand
=
oldExpand
||
false
;
var
Layout
=
node
.
getLayout
();
Layout
.
expand
=
false
;
if
(
parent
.
getType
()
!==
'root'
)
{
parent
.
getLayout
().
expand
=
true
;
}
...
...
src/module/layout.js
View file @
5427c7b0
KityMinder
.
registerModule
(
"LayoutModule"
,
function
()
{
var
me
=
this
;
var
clearPaper
=
function
()
{
me
.
_rc
.
remove
();
me
.
_rc
=
new
kity
.
Group
();
me
.
_paper
.
addShape
(
this
.
_rc
);
};
kity
.
extendClass
(
Minder
,
{
addLayoutStyle
:
function
(
name
,
style
)
{
if
(
!
this
.
_layoutStyles
)
this
.
_layoutStyles
=
{};
...
...
@@ -45,6 +51,11 @@ KityMinder.registerModule( "LayoutModule", function () {
this
.
getLayoutStyle
(
curStyle
).
initStyle
.
call
(
this
,
expandall
);
this
.
fire
(
'afterinitstyle'
);
},
restoreStyle
:
function
()
{
var
curStyle
=
this
.
getCurrentStyle
();
clearPaper
();
var
_root
=
this
.
getRoot
();
},
appendChildNode
:
function
(
parent
,
node
,
focus
,
index
)
{
var
curStyle
=
this
.
getCurrentStyle
();
this
.
getLayoutStyle
(
curStyle
).
appendChildNode
.
call
(
this
,
parent
,
node
,
focus
,
index
);
...
...
@@ -115,7 +126,7 @@ KityMinder.registerModule( "LayoutModule", function () {
if
(
!
parent
)
{
return
null
;
}
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Data
(
"expand"
)
===
false
)
{
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
!==
0
&&
parent
.
get
Layout
().
expand
===
false
)
{
km
.
expandNode
(
parent
);
}
...
...
@@ -251,12 +262,7 @@ KityMinder.registerModule( "LayoutModule", function () {
"cloneNode"
:
function
(
e
)
{
var
target
=
e
.
targetNode
;
var
source
=
e
.
sourceNode
;
target
.
clearLayout
();
var
sourceLayout
=
source
.
getLayout
();
var
targetLayout
=
target
.
getLayout
();
targetLayout
.
expand
=
utils
.
clone
(
sourceLayout
.
expand
);
console
.
log
(
targetLayout
);
target
.
_layout
=
utils
.
extend
(
{},
source
.
_layout
);
}
},
'contextmenu'
:
[
{
...
...
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