mouseover and mouseout events should not fire during drag and drop

This commit is contained in:
Eric Rowell
2012-08-19 23:46:06 -07:00
parent 9093d9a512
commit 0640e0b705
3 changed files with 8 additions and 6 deletions

View File

@@ -3135,9 +3135,10 @@ Kinetic.Stage = Kinetic.Container.extend({
},
_mouseout: function(evt) {
this._setUserPosition(evt);
var go = Kinetic.Global;
// if there's a current target shape, run mouseout handlers
var targetShape = this.targetShape;
if(targetShape) {
if(targetShape && !go.drag.moving) {
targetShape._handleEvent('mouseout', evt);
this.targetShape = null;
}
@@ -3170,7 +3171,7 @@ Kinetic.Stage = Kinetic.Container.extend({
* if no shape was detected, clear target shape and try
* to run mouseout from previous target shape
*/
else if(this.targetShape) {
else if(this.targetShape && !go.drag.moving) {
this.targetShape._handleEvent('mouseout', evt);
this.targetShape = null;
}

File diff suppressed because one or more lines are too long

View File

@@ -456,9 +456,10 @@ Kinetic.Stage = Kinetic.Container.extend({
},
_mouseout: function(evt) {
this._setUserPosition(evt);
var go = Kinetic.Global;
// if there's a current target shape, run mouseout handlers
var targetShape = this.targetShape;
if(targetShape) {
if(targetShape && !go.drag.moving) {
targetShape._handleEvent('mouseout', evt);
this.targetShape = null;
}
@@ -491,7 +492,7 @@ Kinetic.Stage = Kinetic.Container.extend({
* if no shape was detected, clear target shape and try
* to run mouseout from previous target shape
*/
else if(this.targetShape) {
else if(this.targetShape && !go.drag.moving) {
this.targetShape._handleEvent('mouseout', evt);
this.targetShape = null;
}