add back ie fix

This commit is contained in:
Anton Lavrenov
2018-12-18 12:29:48 -05:00
parent d00a5b4a6d
commit 1cbabcb06d
4 changed files with 29 additions and 1 deletions

View File

@@ -5,6 +5,10 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [new version][unreleased] ## [new version][unreleased]
### Fixed
* Better mouse support on mobile devices (yes, that is possible to connect mouse to mobile)
## [2.6.0][2018-12-14] ## [2.6.0][2018-12-14]
### Changed ### Changed

View File

@@ -10933,6 +10933,10 @@
this._fire(CONTENT_MOUSEOUT, { evt: evt }); this._fire(CONTENT_MOUSEOUT, { evt: evt });
}, },
_mousemove: function(evt) { _mousemove: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchmove(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape; var shape;
@@ -10981,6 +10985,10 @@
} }
}, },
_mousedown: function(evt) { _mousedown: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchstart(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape = this.getIntersection(this.getPointerPosition()); var shape = this.getIntersection(this.getPointerPosition());
@@ -11010,6 +11018,10 @@
// } // }
}, },
_mouseup: function(evt) { _mouseup: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchend(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape = this.getIntersection(this.getPointerPosition()), var shape = this.getIntersection(this.getPointerPosition()),
clickStartShape = this.clickStartShape, clickStartShape = this.clickStartShape,

2
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -413,6 +413,10 @@
this._fire(CONTENT_MOUSEOUT, { evt: evt }); this._fire(CONTENT_MOUSEOUT, { evt: evt });
}, },
_mousemove: function(evt) { _mousemove: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchmove(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape; var shape;
@@ -461,6 +465,10 @@
} }
}, },
_mousedown: function(evt) { _mousedown: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchstart(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape = this.getIntersection(this.getPointerPosition()); var shape = this.getIntersection(this.getPointerPosition());
@@ -490,6 +498,10 @@
// } // }
}, },
_mouseup: function(evt) { _mouseup: function(evt) {
// workaround for mobile IE to force touch event when unhandled pointer event elevates into a mouse event
if (Konva.UA.ieMobile) {
return this._touchend(evt);
}
this._setPointerPosition(evt); this._setPointerPosition(evt);
var shape = this.getIntersection(this.getPointerPosition()), var shape = this.getIntersection(this.getPointerPosition()),
clickStartShape = this.clickStartShape, clickStartShape = this.clickStartShape,