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
3d19060c
Commit
3d19060c
authored
Mar 10, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抽取视野定位功能为 camera 命令
parent
8292538a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
12 deletions
+20
-12
import.php
dev/import.php
+1
-1
social.js
social/social.js
+1
-0
view.js
src/module/view.js
+18
-11
No files found.
dev/import.php
View file @
3d19060c
...
...
@@ -23,7 +23,7 @@ $dependency = Array(
,
'src/module/layout.default.js'
,
'src/module/layout.bottom.js'
,
'src/core/minder.select.js'
,
'src/module/
hand
.js'
,
'src/module/
view
.js'
,
'src/module/dragtree.js'
,
'src/module/dropfile.js'
,
'src/module/keyboard.js'
...
...
social/social.js
View file @
3d19060c
...
...
@@ -189,6 +189,7 @@ $( function () {
function
newFile
()
{
thisMapFilename
=
null
;
window
.
km
.
importData
(
'新建脑图'
,
'plain'
);
window
.
km
.
execCommand
(
'camera'
,
window
.
km
.
getRoot
()
);
$user_btn
.
text
(
'<新建脑图>'
);
}
...
...
src/module/
hand
.js
→
src/module/
view
.js
View file @
3d19060c
...
...
@@ -39,9 +39,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
();
...
...
@@ -75,7 +75,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
}
);
KityMinder
.
registerModule
(
'
Hand
'
,
function
()
{
KityMinder
.
registerModule
(
'
View
'
,
function
()
{
var
km
=
this
;
...
...
@@ -96,12 +96,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
)
{
...
...
@@ -113,7 +125,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
)
{
...
...
@@ -136,12 +148,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
()
);
}
}
};
...
...
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