mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
fixed #348
This commit is contained in:
@@ -54,8 +54,35 @@ var Kinetic = {};
|
||||
* @methodOf Kinetic.Global
|
||||
*/
|
||||
isDragging: function() {
|
||||
var dd = Kinetic.DD;
|
||||
return (!dd || dd.isDragging);
|
||||
var dd = Kinetic.DD;
|
||||
|
||||
// if DD is not included with the build, then
|
||||
// drag and drop is not even possible
|
||||
if (!dd) {
|
||||
return false;
|
||||
}
|
||||
// if DD is included with the build
|
||||
else {
|
||||
return dd.isDragging;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* @method isDragReady returns whether or not a drag and drop operation is ready, but may
|
||||
* not necessarily have started
|
||||
* @methodOf Kinetic.Global
|
||||
*/
|
||||
isDragReady: function() {
|
||||
var dd = Kinetic.DD;
|
||||
|
||||
// if DD is not included with the build, then
|
||||
// drag and drop is not even possible
|
||||
if (!dd) {
|
||||
return false;
|
||||
}
|
||||
// if DD is included with the build
|
||||
else {
|
||||
return !!dd.node;
|
||||
}
|
||||
},
|
||||
warn: function(str) {
|
||||
/*
|
||||
|
@@ -412,10 +412,9 @@
|
||||
},
|
||||
_mousedown: function(evt) {
|
||||
this._setPointerPosition(evt);
|
||||
var dd = Kinetic.DD,
|
||||
go = Kinetic.Global,
|
||||
obj = this.getIntersection(this.getPointerPosition()),
|
||||
shape;
|
||||
var go = Kinetic.Global,
|
||||
obj = this.getIntersection(this.getPointerPosition()),
|
||||
shape;
|
||||
|
||||
if(obj && obj.shape) {
|
||||
shape = obj.shape;
|
||||
@@ -425,7 +424,7 @@
|
||||
}
|
||||
|
||||
//init stage drag and drop
|
||||
if(this.isDraggable() && !dd.node) {
|
||||
if(this.isDraggable() && !go.isDragReady()) {
|
||||
this.startDrag(evt);
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user