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
342bbdc9
Commit
342bbdc9
authored
Feb 28, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix
parent
cc6e3076
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
5 deletions
+24
-5
kity
kity
+1
-1
node.js
src/core/node.js
+1
-1
hand.js
src/module/hand.js
+22
-3
No files found.
kity
@
ebccc80b
Subproject commit
48128c2e87fb9c8f2f93e64fc2df3f04ffa0a692
Subproject commit
ebccc80ba41995fa718b1fb0b8f7d79938501ed1
src/core/node.js
View file @
342bbdc9
...
...
@@ -180,7 +180,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
node
.
parent
.
removeChild
(
node
);
}
node
.
parent
=
this
;
node
.
root
=
parent
.
root
;
node
.
root
=
node
.
parent
.
root
;
this
.
children
.
splice
(
index
,
0
,
node
);
},
...
...
src/module/hand.js
View file @
342bbdc9
...
...
@@ -17,6 +17,9 @@ var ViewDragger = kity.createClass( "ViewDragger", {
paper
.
setStyle
(
'cursor'
,
value
?
'-webkit-grab'
:
'default'
);
this
.
_enabled
=
value
;
},
move
:
function
(
offset
)
{
this
.
_minder
.
getRenderContainer
().
translate
(
offset
.
x
,
offset
.
y
);
},
_bind
:
function
()
{
var
dragger
=
this
,
...
...
@@ -33,7 +36,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
}
// 点击未选中的根节点临时开启
else
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
())
)
{
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
()
)
)
{
lastPosition
=
e
.
getPosition
();
dragger
.
setEnabled
(
true
);
isRootDrag
=
true
;
...
...
@@ -47,8 +50,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
// 当前偏移加上历史偏移
var
offset
=
kity
.
Vector
.
fromPoints
(
lastPosition
,
currentPosition
);
this
.
getRenderContainer
().
translate
(
offset
.
x
,
offset
.
y
);
dragger
.
move
(
offset
);
e
.
stopPropagation
();
lastPosition
=
currentPosition
;
}
...
...
@@ -90,6 +92,23 @@ KityMinder.registerModule( 'Hand', function () {
this
.
execCommand
(
'hand'
);
e
.
preventDefault
();
}
},
mousewheel
:
function
(
e
)
{
var
dx
=
e
.
originEvent
.
wheelDeltaX
||
e
.
originEvent
.
wheelDelta
,
dy
=
e
.
originEvent
.
wheelDeltaY
||
0
;
this
.
_viewDragger
.
move
(
{
x
:
dx
/
2.5
,
y
:
dy
/
2.5
}
);
e
.
originEvent
.
preventDefault
();
},
dblclick
:
function
()
{
var
viewport
=
this
.
getPaper
().
getViewPort
();
var
offset
=
this
.
getRoot
().
getRenderContainer
(
this
.
getRenderContainer
()).
getTransform
().
getTranslate
();
var
dx
=
viewport
.
center
.
x
-
offset
.
x
,
dy
=
viewport
.
center
.
y
-
offset
.
y
;
this
.
getRenderContainer
().
fxTranslate
(
dx
,
dy
,
300
);
}
}
};
...
...
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