mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
mouseover and mouseout events should not fire during drag and drop
This commit is contained in:
5
dist/kinetic-core.js
vendored
5
dist/kinetic-core.js
vendored
@@ -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;
|
||||
}
|
||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user