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
b5dc9fc3
Commit
b5dc9fc3
authored
Feb 24, 2014
by
campaign
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into gh-pages
parents
fc4ed32b
95884921
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
node.js
src/core/node.js
+12
-8
editor.js
src/module/editor.js
+3
-0
layout.default.js
src/module/layout.default.js
+8
-2
No files found.
src/core/node.js
View file @
b5dc9fc3
...
...
@@ -35,7 +35,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
},
_createTextShape
:
function
()
{
var
textShape
=
new
kity
.
Text
(
this
.
getData
(
'text'
)
||
''
);
textShape
.
setAttr
(
'_nodeTextShape'
,
true
);
textShape
.
setAttr
(
'_nodeTextShape'
,
true
);
this
.
getContRc
().
appendShape
(
textShape
);
},
_createIconShape
:
function
()
{
...
...
@@ -69,10 +69,14 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
return
this
.
_iconRc
;
},
setPoint
:
function
(
x
,
y
)
{
this
.
setData
(
'point'
,
{
x
:
x
,
y
:
y
}
);
if
(
arguments
.
length
<
2
)
{
this
.
setData
(
"point"
,
x
);
}
else
{
this
.
setData
(
'point'
,
{
x
:
x
,
y
:
y
}
);
}
},
getPoint
:
function
()
{
return
this
.
getData
(
'point'
);
...
...
@@ -304,12 +308,12 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
},
getTextShape
:
function
()
{
var
textShape
;
utils
.
each
(
this
.
getContRc
().
getShapesByType
(
'text'
),
function
(
i
,
t
)
{
if
(
t
.
getAttr
(
'_nodeTextShape'
))
{
utils
.
each
(
this
.
getContRc
().
getShapesByType
(
'text'
),
function
(
i
,
t
)
{
if
(
t
.
getAttr
(
'_nodeTextShape'
)
)
{
textShape
=
t
;
return
false
;
}
});
}
);
return
textShape
;
},
isSelected
:
function
()
{
...
...
src/module/editor.js
View file @
b5dc9fc3
...
...
@@ -132,6 +132,9 @@ KityMinder.registerModule( "TextEditModule", function () {
sel
.
setHide
();
receiver
.
clear
().
setTextEditStatus
(
false
);
},
"resize"
:
function
(
e
)
{
sel
.
setHide
();
},
'execCommand'
:
function
(
e
){
var
cmds
=
{
'appendchildnode'
:
1
,
...
...
src/module/layout.default.js
View file @
b5dc9fc3
...
...
@@ -249,7 +249,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
childLayout
.
y
=
sY
+
childLayout
.
branchheight
/
2
;
sY
+=
childLayout
.
branchheight
;
}
effectSet
.
push
(
_buffer
[
0
]
);
if
(
_buffer
[
0
]
!==
root
)
effectSet
.
push
(
_buffer
[
0
]
);
_buffer
.
shift
();
}
}
...
...
@@ -432,6 +432,8 @@ KityMinder.registerModule( "LayoutDefault", function () {
},
initStyle
:
function
()
{
var
_root
=
minder
.
getRoot
();
var
historyPoint
=
_root
.
getPoint
();
if
(
historyPoint
)
historyPoint
=
JSON
.
parse
(
JSON
.
stringify
(
historyPoint
)
);
minder
.
handelNodeInsert
(
_root
);
//设置root的align
_root
.
getLayout
().
align
=
"center"
;
...
...
@@ -460,10 +462,14 @@ KityMinder.registerModule( "LayoutDefault", function () {
if
(
_buffer
[
0
]
!==
_root
)
_cleanbuffer
.
push
(
_buffer
[
0
]
);
_buffer
.
shift
();
}
if
(
historyPoint
)
{
_root
.
setPoint
(
historyPoint
);
}
//重组结构
for
(
var
j
=
0
;
j
<
_cleanbuffer
.
length
;
j
++
)
{
this
.
appendChildNode
(
_cleanbuffer
[
j
].
getLayout
().
parent
,
_cleanbuffer
[
j
]
);
}
_root
.
setPoint
(
_root
.
getLayout
().
x
,
_root
.
getLayout
().
y
);
},
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
minder
.
handelNodeInsert
(
node
);
...
...
@@ -499,7 +505,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
}
else
{
var
nodeP
=
node
.
getPoint
();
if
(
nodeP
&&
nodeP
.
x
&&
nodeP
.
y
)
{
if
(
nodeP
.
x
>
parent
Layout
.
x
)
{
if
(
nodeP
.
x
>
parent
.
getPoint
()
.
x
)
{
Layout
.
appendside
=
"right"
;
Layout
.
align
=
"left"
;
}
else
{
...
...
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