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
fdf7d32e
Commit
fdf7d32e
authored
Mar 18, 2014
by
Akikonata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
8942a6ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
32 deletions
+54
-32
kityminder.all.js
dist/kityminder.all.js
+46
-25
kityminder.all.min.js
dist/kityminder.all.min.js
+6
-6
publish
publish
+2
-1
No files found.
dist/kityminder.all.js
View file @
fdf7d32e
/*!
* ====================================================
* kityminder - v1.0.0 - 2014-03-1
0
* kityminder - v1.0.0 - 2014-03-1
8
* https://github.com/fex-team/kityminder
* GitHub: https://github.com/fex-team/kityminder.git
* Copyright (c) 2014 f-cube @ FEX; Licensed MIT
...
...
@@ -1089,7 +1089,7 @@ kity.extendClass( Minder, {
},
// TODO: mousemove lazy bind
_bindPaperEvents
:
function
()
{
this
.
_paper
.
on
(
'click dblclick mousedown contextmenu mouseup mousemove mousewheel touchstart touchmove touchend'
,
this
.
_firePharse
.
bind
(
this
)
);
this
.
_paper
.
on
(
'click dblclick mousedown contextmenu mouseup mousemove mousewheel
DOMMouseScroll
touchstart touchmove touchend'
,
this
.
_firePharse
.
bind
(
this
)
);
if
(
window
)
{
window
.
addEventListener
(
'resize'
,
this
.
_firePharse
.
bind
(
this
)
);
}
...
...
@@ -1103,6 +1103,10 @@ kity.extendClass( Minder, {
_firePharse
:
function
(
e
)
{
var
beforeEvent
,
preEvent
,
executeEvent
;
if
(
e
.
type
==
'DOMMouseScroll'
)
{
e
.
type
=
'mousewheel'
;
e
.
wheelDelta
=
e
.
originEvent
.
wheelDelta
=
e
.
originEvent
.
detail
*
120
;
}
beforeEvent
=
new
MinderEvent
(
'before'
+
e
.
type
,
e
,
true
);
if
(
this
.
_fire
(
beforeEvent
)
)
{
...
...
@@ -1143,17 +1147,17 @@ kity.extendClass( Minder, {
var
callbacks
=
this
.
_eventCallbacks
[
e
.
type
.
toLowerCase
()
]
||
[];
if
(
status
)
{
if
(
status
)
{
callbacks
=
callbacks
.
concat
(
this
.
_eventCallbacks
[
status
+
'.'
+
e
.
type
.
toLowerCase
()
]
||
[]
);
callbacks
=
callbacks
.
concat
(
this
.
_eventCallbacks
[
status
+
'.'
+
e
.
type
.
toLowerCase
()
]
||
[]
);
}
if
(
callbacks
.
length
==
0
)
{
if
(
callbacks
.
length
===
0
)
{
return
;
}
var
lastStatus
=
this
.
getStatus
();
var
lastStatus
=
this
.
getStatus
();
for
(
var
i
=
0
;
i
<
callbacks
.
length
;
i
++
)
{
...
...
@@ -1168,18 +1172,18 @@ kity.extendClass( Minder, {
},
on
:
function
(
name
,
callback
)
{
var
km
=
this
;
utils
.
each
(
name
.
split
(
/
\s
+/
),
function
(
i
,
n
)
{
utils
.
each
(
name
.
split
(
/
\s
+/
),
function
(
i
,
n
)
{
km
.
_listen
(
n
.
toLowerCase
(),
callback
);
});
}
);
return
this
;
},
off
:
function
(
name
,
callback
)
{
var
types
=
name
.
split
(
/
\s
+/
);
var
types
=
name
.
split
(
/
\s
+/
);
var
i
,
j
,
callbacks
,
removeIndex
;
for
(
i
=
0
;
i
<
types
.
length
;
i
++
)
{
callbacks
=
this
.
_eventCallbacks
[
types
[
i
].
toLowerCase
()
];
callbacks
=
this
.
_eventCallbacks
[
types
[
i
].
toLowerCase
()
];
if
(
callbacks
)
{
removeIndex
=
null
;
for
(
j
=
0
;
j
<
callbacks
.
length
;
j
++
)
{
...
...
@@ -2710,6 +2714,11 @@ KityMinder.registerModule( "LayoutDefault", function () {
sideList
.
splice
(
index
,
1
);
}
parent
.
removeChild
(
nodes
[
0
]
);
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
===
0
)
{
var
prtLayout
=
parent
.
getLayout
();
prtLayout
.
shicon
.
remove
();
prtLayout
.
shicon
=
null
;
}
var
set
=
updateLayoutVertical
(
nodes
[
0
],
parent
,
"remove"
);
for
(
var
j
=
0
;
j
<
set
.
length
;
j
++
)
{
translateNode
(
set
[
j
]
);
...
...
@@ -2961,7 +2970,7 @@ KityMinder.registerModule( "LayoutBottom", function () {
var
sX
=
rootLayout
.
x
-
rootbranchwidth
/
2
;
for
(
var
k
=
0
;
k
<
mainnodes
.
length
;
k
++
)
{
var
mLayout
=
mainnodes
[
k
].
getLayout
();
mLayout
.
x
=
sX
;
mLayout
.
x
=
sX
+
nodeStyles
.
main
.
margin
[
3
]
+
5
;
sX
+=
mLayout
.
branchwidth
;
}
return
mainnodes
;
...
...
@@ -3254,6 +3263,11 @@ KityMinder.registerModule( "LayoutBottom", function () {
}
var
nodeLayout
=
nodes
[
0
].
getLayout
();
parent
.
removeChild
(
nodes
[
0
]
);
if
(
parent
.
getType
()
!==
"root"
&&
parent
.
getChildren
().
length
===
0
)
{
var
prtLayout
=
parent
.
getLayout
();
prtLayout
.
shicon
.
remove
();
prtLayout
.
shicon
=
null
;
}
var
set
=
updateLayoutAll
(
nodes
[
0
],
parent
,
"remove"
);
for
(
var
j
=
0
;
j
<
set
.
length
;
j
++
)
{
translateNode
(
set
[
j
]
);
...
...
@@ -3481,9 +3495,9 @@ var ViewDragger = kity.createClass( "ViewDragger", {
me
.
setStatus
(
'hand'
);
},
1
);
}
}
)
;
}
)
this
.
_minder
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
// 已经被用户打开拖放模式
if
(
dragger
.
isEnabled
()
)
{
lastPosition
=
e
.
getPosition
();
...
...
@@ -3517,7 +3531,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
}
);
KityMinder
.
registerModule
(
'
Hand
'
,
function
()
{
KityMinder
.
registerModule
(
'
View
'
,
function
()
{
var
km
=
this
;
...
...
@@ -3538,12 +3552,24 @@ KityMinder.registerModule( 'Hand', function () {
}
}
);
var
CameraCommand
=
kity
.
createClass
(
"CameraCommand"
,
{
base
:
Command
,
execute
:
function
(
km
,
focusNode
)
{
var
viewport
=
km
.
getPaper
().
getViewPort
();
var
offset
=
focusNode
.
getRenderContainer
().
getRenderBox
(
km
.
getRenderContainer
()
);
var
dx
=
viewport
.
center
.
x
-
offset
.
x
-
offset
.
width
/
2
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
km
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
1000
,
"easeOutQuint"
);
}
}
);
return
{
init
:
function
()
{
this
.
_viewDragger
=
new
ViewDragger
(
this
);
},
commands
:
{
'hand'
:
ToggleHandCommand
'hand'
:
ToggleHandCommand
,
'camera'
:
CameraCommand
},
events
:
{
keyup
:
function
(
e
)
{
...
...
@@ -3555,7 +3581,7 @@ KityMinder.registerModule( 'Hand', function () {
mousewheel
:
function
(
e
)
{
var
dx
,
dy
;
e
=
e
.
originEvent
;
if
(
e
.
ctrlKey
||
e
.
shiftKey
)
return
;
if
(
e
.
ctrlKey
||
e
.
shiftKey
)
return
;
if
(
'wheelDeltaX'
in
e
)
{
...
...
@@ -3578,12 +3604,7 @@ KityMinder.registerModule( 'Hand', function () {
},
'normal.dblclick'
:
function
(
e
)
{
if
(
e
.
getTargetNode
()
)
return
;
var
viewport
=
this
.
getPaper
().
getViewPort
();
var
offset
=
this
.
getRoot
().
getRenderContainer
().
getRenderBox
(
this
.
getRenderContainer
()
);
var
dx
=
viewport
.
center
.
x
-
offset
.
x
-
offset
.
width
/
2
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
this
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
1000
,
"easeOutQuint"
);
this
.
execCommand
(
'camera'
,
this
.
getRoot
()
);
}
}
};
...
...
@@ -3905,10 +3926,10 @@ KityMinder.registerModule( "KeyboardModule", function () {
var
pointIndexes
=
[],
p
;
root
.
traverse
(
function
(
node
)
{
p
=
node
.
get
Data
(
'point
'
);
p
=
node
.
get
RenderContainer
().
getRenderBox
(
'top
'
);
pointIndexes
.
push
(
{
x
:
p
.
x
,
y
:
p
.
y
,
x
:
p
.
x
+
p
.
width
/
2
,
y
:
p
.
y
+
p
.
height
/
2
,
node
:
node
}
);
}
);
...
...
dist/kityminder.all.min.js
View file @
fdf7d32e
This source diff could not be displayed because it is too large. You can
view the blob
instead.
publish
View file @
fdf7d32e
...
...
@@ -2,7 +2,8 @@ git stash
git checkout gh-pages
git merge dev -m "merge from dev"
grunt
git commit -am "publish"
git add dist
git commit -m "publish"
git push origin gh-pages
git checkout dev
git stash pop
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