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
c658355d
Commit
c658355d
authored
Feb 19, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
c3581375
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
9 deletions
+16
-9
layout.bottom.js
src/module/layout.bottom.js
+5
-3
layout.default.js
src/module/layout.default.js
+3
-2
modal.js
src/ui/modal.js
+8
-4
No files found.
src/module/layout.bottom.js
View file @
c658355d
...
@@ -224,7 +224,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -224,7 +224,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
return
(
selfWidth
>
childWidth
?
selfWidth
:
childWidth
);
return
(
selfWidth
>
childWidth
?
selfWidth
:
childWidth
);
};
};
if
(
nodeType
===
"root"
)
{
if
(
nodeType
===
"root"
)
{
Layout
.
x
=
getMinderSize
().
width
/
2
;
Layout
.
x
=
getMinderSize
().
width
/
2
-
node
.
getRenderContainer
().
getWidth
()
/
2
;
effectSet
.
push
(
node
);
effectSet
.
push
(
node
);
}
else
{
}
else
{
if
(
action
===
"append"
||
action
===
"contract"
)
{
if
(
action
===
"append"
||
action
===
"contract"
)
{
...
@@ -427,6 +427,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -427,6 +427,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
}
},
},
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
appendChildNode
:
function
(
parent
,
node
,
sibling
)
{
minder
.
handelNodeInsert
(
node
);
node
.
clearLayout
();
//设置分支类型
//设置分支类型
if
(
parent
.
getType
()
===
"root"
)
{
if
(
parent
.
getType
()
===
"root"
)
{
node
.
setType
(
"main"
);
node
.
setType
(
"main"
);
...
@@ -443,8 +445,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
...
@@ -443,8 +445,8 @@ KityMinder.registerModule( "LayoutBottom", function () {
node
:
node
node
:
node
},
false
)
);
},
false
)
);
updateShapeByCont
(
node
);
updateShapeByCont
(
node
);
var
set
1
=
updateLayoutVertical
(
node
,
parent
,
"append"
);
var
set
2
=
updateLayoutHorizon
(
node
,
parent
,
"append"
);
var
set
2
=
updateLayoutHorizon
(
node
);
var
set
1
=
updateLayoutVertical
(
node
);
var
set
=
uSet
(
set1
,
set2
);
var
set
=
uSet
(
set1
,
set2
);
for
(
var
i
=
0
;
i
<
set
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
set
.
length
;
i
++
)
{
translateNode
(
set
[
i
]
);
translateNode
(
set
[
i
]
);
...
...
src/module/layout.default.js
View file @
c658355d
...
@@ -53,9 +53,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -53,9 +53,10 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
nodeShape
=
node
.
getRenderContainer
();
var
nodeShape
=
node
.
getRenderContainer
();
var
nodeX
,
nodeY
=
(
node
.
getType
()
===
"main"
?
Layout
.
y
:
(
Layout
.
y
+
nodeShape
.
getHeight
()
/
2
-
5
)
);
var
nodeX
,
nodeY
=
(
node
.
getType
()
===
"main"
?
Layout
.
y
:
(
Layout
.
y
+
nodeShape
.
getHeight
()
/
2
-
5
)
);
if
(
Layout
.
appendside
===
"left"
)
{
if
(
Layout
.
appendside
===
"left"
)
{
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
1
].
x
-
6
;
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
1
].
x
-
5
;
}
else
{
}
else
{
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
0
].
x
+
6
;
nodeX
=
nodeShape
.
getRenderBox
().
closurePoints
[
0
].
x
+
6
;
if
(
node
.
getType
()
===
"main"
)
nodeX
-=
3
;
}
}
this
.
shape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
nodeX
,
nodeY
)
);
this
.
shape
.
setTransform
(
new
kity
.
Matrix
().
translate
(
nodeX
,
nodeY
)
);
},
},
...
@@ -340,7 +341,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
...
@@ -340,7 +341,7 @@ KityMinder.registerModule( "LayoutDefault", function () {
var
endPosV
=
endPos
.
getVertex
();
var
endPosV
=
endPos
.
getVertex
();
sPos
.
setVertex
(
rootX
,
rootY
);
sPos
.
setVertex
(
rootX
,
rootY
);
connect
.
bezier
.
setPoints
(
[
sPos
,
endPos
]
).
stroke
(
nodeStyle
.
stroke
);
connect
.
bezier
.
setPoints
(
[
sPos
,
endPos
]
).
stroke
(
nodeStyle
.
stroke
);
connect
.
circle
.
setCenter
(
endPosV
.
x
+
(
Layout
.
appendside
===
"left"
?
1
:
-
1.5
),
endPosV
.
y
).
fill
(
"white"
).
setRadius
(
4
);
connect
.
circle
.
setCenter
(
endPosV
.
x
+
(
Layout
.
appendside
===
"left"
?
-
0.5
:
-
1.5
),
endPosV
.
y
).
fill
(
"white"
).
setRadius
(
4
);
}
else
if
(
nodeType
===
"sub"
)
{
}
else
if
(
nodeType
===
"sub"
)
{
if
(
!
Layout
.
connect
)
{
if
(
!
Layout
.
connect
)
{
connect
=
Layout
.
connect
=
new
kity
.
Path
();
connect
=
Layout
.
connect
=
new
kity
.
Path
();
...
...
src/ui/modal.js
View file @
c658355d
...
@@ -44,9 +44,11 @@ KM.ui.define( 'modal', {
...
@@ -44,9 +44,11 @@ KM.ui.define( 'modal', {
$
(
this
).
toggleClass
(
'kmui-hover'
)
$
(
this
).
toggleClass
(
'kmui-hover'
)
}
);
}
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
$
(
'.kmui-modal'
).
draggable
({
handle
:
'.kmui-modal-header'
});
$
(
'.kmui-modal'
).
draggable
(
{
},
100
);
handle
:
'.kmui-modal-header'
}
);
},
100
);
},
},
toggle
:
function
()
{
toggle
:
function
()
{
var
me
=
this
;
var
me
=
this
;
...
@@ -71,7 +73,9 @@ KM.ui.define( 'modal', {
...
@@ -71,7 +73,9 @@ KM.ui.define( 'modal', {
.
trigger
(
'aftershow'
);
.
trigger
(
'aftershow'
);
}
);
}
);
$
(
'.kmui-modal'
).
draggable
({
handle
:
'.kmui-modal-header'
});
$
(
'.kmui-modal'
).
draggable
(
{
handle
:
'.kmui-modal-header'
}
);
},
},
showTip
:
function
(
text
)
{
showTip
:
function
(
text
)
{
$
(
'.kmui-modal-tip'
,
this
.
root
()
).
html
(
text
).
fadeIn
();
$
(
'.kmui-modal-tip'
,
this
.
root
()
).
html
(
text
).
fadeIn
();
...
...
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