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
dd2699be
Commit
dd2699be
authored
Mar 03, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug fix: hand and drag
parent
9b8dddbf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
17 deletions
+25
-17
kity
kity
+1
-1
dragtree.js
src/module/dragtree.js
+3
-2
hand.js
src/module/hand.js
+21
-14
No files found.
kity
@
26f98367
Subproject commit
a9630e638b29633f62cdc2df239bc702118b231a
Subproject commit
26f9836718affd92c95196be698b14b1c6da4a95
src/module/dragtree.js
View file @
dd2699be
...
...
@@ -261,11 +261,12 @@ KityMinder.registerModule( "DragTree", function () {
this
.
_dragBox
.
dragStart
(
e
.
getPosition
()
);
}
},
mousemove
:
function
(
e
)
{
'mousemove'
:
function
(
e
)
{
this
.
_dragBox
.
dragMove
(
e
.
getPosition
()
);
},
mouseup
:
function
(
e
)
{
'mouseup'
:
function
(
e
)
{
this
.
_dragBox
.
dragEnd
();
this
.
rollbackStatus
();
}
},
commands
:
{
...
...
src/module/hand.js
View file @
dd2699be
...
...
@@ -27,21 +27,27 @@ var ViewDragger = kity.createClass( "ViewDragger", {
lastPosition
=
null
,
currentPosition
=
null
;
this
.
_minder
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
// 已经被用户打开拖放模式
if
(
dragger
.
isEnabled
()
)
{
lastPosition
=
e
.
getPosition
();
e
.
stopPropagation
();
e
.
originEvent
.
preventDefault
();
}
this
.
_minder
.
on
(
'normal.beforemousedown'
,
function
(
e
)
{
// 点击未选中的根节点临时开启
else
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
if
(
e
.
getTargetNode
()
==
this
.
getRoot
()
&&
(
!
this
.
getRoot
().
isSelected
()
||
!
this
.
isSingleSelect
()
)
)
{
lastPosition
=
e
.
getPosition
();
dragger
.
setEnabled
(
true
);
isRootDrag
=
true
;
var
me
=
this
;
setTimeout
(
function
()
{
me
.
setStatus
(
'hand'
);
},
1
);
}
}
);
this
.
_minder
.
on
(
'hand.beforemousedown'
,
function
(
e
)
{
// 已经被用户打开拖放模式
if
(
dragger
.
isEnabled
()
)
{
lastPosition
=
e
.
getPosition
();
e
.
stopPropagation
();
e
.
originEvent
.
preventDefault
();
}
}
)
.
on
(
'hand.beforemousemove'
,
function
(
e
)
{
...
...
@@ -63,6 +69,7 @@ var ViewDragger = kity.createClass( "ViewDragger", {
if
(
isRootDrag
)
{
dragger
.
setEnabled
(
false
);
isRootDrag
=
false
;
this
.
rollbackStatus
();
}
}
);
}
...
...
@@ -77,10 +84,10 @@ KityMinder.registerModule( 'Hand', function () {
execute
:
function
(
minder
)
{
minder
.
_viewDragger
.
setEnabled
(
!
minder
.
_viewDragger
.
isEnabled
()
);
if
(
minder
.
_viewDragger
.
isEnabled
())
{
minder
.
setStatus
(
'hand'
)
}
else
{
minder
.
rollbackStatus
()
if
(
minder
.
_viewDragger
.
isEnabled
()
)
{
minder
.
setStatus
(
'hand'
);
}
else
{
minder
.
rollbackStatus
()
;
}
},
...
...
@@ -113,9 +120,9 @@ KityMinder.registerModule( 'Hand', function () {
e
.
originEvent
.
preventDefault
();
},
dblclick
:
function
()
{
dblclick
:
function
()
{
var
viewport
=
this
.
getPaper
().
getViewPort
();
var
offset
=
this
.
getRoot
().
getRenderContainer
(
this
.
getRenderContainer
()
).
getTransform
().
getTranslate
();
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