@shapediver/viewer.shared.services
Advanced tools
Comparing version 1.14.13 to 1.14.14
@@ -14,5 +14,7 @@ import { IDomEventListener } from './IDomEventListener'; | ||
private _onMouseUp; | ||
private _onMouseOut; | ||
private _onTouchStart; | ||
private _onTouchMove; | ||
private _onTouchEnd; | ||
private _onTouchUp; | ||
private _onTouchCancel; | ||
private _onKeyDown; | ||
@@ -55,4 +57,6 @@ private _onContextMenu; | ||
private onMouseUp; | ||
private onMouseOut; | ||
private onMouseWheel; | ||
private onTouchEnd; | ||
private onTouchUp; | ||
private onTouchCancel; | ||
private onTouchMove; | ||
@@ -59,0 +63,0 @@ private onTouchStart; |
@@ -34,5 +34,7 @@ "use strict"; | ||
this._onMouseUp = this.onMouseUp.bind(this); | ||
this._onMouseOut = this.onMouseOut.bind(this); | ||
this._onTouchStart = this.onTouchStart.bind(this); | ||
this._onTouchMove = this.onTouchMove.bind(this); | ||
this._onTouchEnd = this.onTouchEnd.bind(this); | ||
this._onTouchUp = this.onTouchUp.bind(this); | ||
this._onTouchCancel = this.onTouchCancel.bind(this); | ||
this._onKeyDown = this.onKeyDown.bind(this); | ||
@@ -102,6 +104,6 @@ this._onContextMenu = this.onContextMenu.bind(this); | ||
if (allowedListeners.mouseout) { | ||
this._canvas.addEventListener("mouseout", this._onMouseUp); | ||
this._canvas.addEventListener("mouseout", this._onMouseOut); | ||
} | ||
else { | ||
this._canvas.removeEventListener("mouseout", this._onMouseUp); | ||
this._canvas.removeEventListener("mouseout", this._onMouseOut); | ||
} | ||
@@ -130,6 +132,6 @@ this._allowListeners.mouseout = allowedListeners.mouseout; | ||
if (allowedListeners.touchend) { | ||
window.addEventListener("touchend", this._onTouchEnd); | ||
window.addEventListener("touchend", this._onTouchUp); | ||
} | ||
else { | ||
window.removeEventListener("touchend", this._onTouchEnd); | ||
window.removeEventListener("touchend", this._onTouchUp); | ||
} | ||
@@ -140,6 +142,6 @@ this._allowListeners.touchend = allowedListeners.touchend; | ||
if (allowedListeners.touchcancel) { | ||
window.addEventListener("touchcancel", this._onTouchEnd); | ||
window.addEventListener("touchcancel", this._onTouchCancel); | ||
} | ||
else { | ||
window.removeEventListener("touchcancel", this._onTouchEnd); | ||
window.removeEventListener("touchcancel", this._onTouchCancel); | ||
} | ||
@@ -189,7 +191,7 @@ this._allowListeners.touchcancel = allowedListeners.touchcancel; | ||
this._canvas.addEventListener("mouseup", this._onMouseUp); | ||
this._canvas.addEventListener("mouseout", this._onMouseUp); | ||
this._canvas.addEventListener("mouseout", this._onMouseOut); | ||
window.addEventListener("touchstart", this._onTouchStart); | ||
window.addEventListener("touchmove", this._onTouchMove); | ||
window.addEventListener("touchend", this._onTouchEnd); | ||
window.addEventListener("touchcancel", this._onTouchEnd); | ||
window.addEventListener("touchend", this._onTouchUp); | ||
window.addEventListener("touchcancel", this._onTouchCancel); | ||
window.addEventListener("keydown", this._onKeyDown); | ||
@@ -221,3 +223,9 @@ window.addEventListener("mousemove", this._onKeyDownMousePositionHelper); | ||
Object.values(this._domEventListeners).forEach(e => e.onMouseUp(event)); | ||
Object.values(this._domEventListeners).forEach(e => e.onMouseEnd(event)); | ||
} | ||
onMouseOut(event) { | ||
event.preventDefault(); | ||
Object.values(this._domEventListeners).forEach(e => e.onMouseOut(event)); | ||
Object.values(this._domEventListeners).forEach(e => e.onMouseEnd(event)); | ||
} | ||
onMouseWheel(event) { | ||
@@ -228,8 +236,16 @@ event.preventDefault(); | ||
} | ||
onTouchEnd(event) { | ||
onTouchUp(event) { | ||
if (event.composedPath().includes(this._canvas)) { | ||
event.preventDefault(); | ||
Object.values(this._domEventListeners).forEach(e => e.onTouchUp(event)); | ||
Object.values(this._domEventListeners).forEach(e => e.onTouchEnd(event)); | ||
} | ||
} | ||
onTouchCancel(event) { | ||
if (event.composedPath().includes(this._canvas)) { | ||
event.preventDefault(); | ||
Object.values(this._domEventListeners).forEach(e => e.onTouchCancel(event)); | ||
Object.values(this._domEventListeners).forEach(e => e.onTouchEnd(event)); | ||
} | ||
} | ||
onTouchMove(event) { | ||
@@ -253,7 +269,7 @@ if (event.composedPath().includes(this._canvas)) { | ||
this._canvas.removeEventListener("mouseup", this._onMouseUp); | ||
this._canvas.removeEventListener("mouseout", this._onMouseUp); | ||
this._canvas.removeEventListener("mouseout", this._onMouseOut); | ||
window.removeEventListener("touchstart", this._onTouchStart); | ||
window.removeEventListener("touchmove", this._onTouchMove); | ||
window.removeEventListener("touchend", this._onTouchEnd); | ||
window.removeEventListener("touchcancel", this._onTouchEnd); | ||
window.removeEventListener("touchend", this._onTouchUp); | ||
window.removeEventListener("touchcancel", this._onTouchCancel); | ||
window.removeEventListener("keydown", this._onKeyDown); | ||
@@ -260,0 +276,0 @@ window.removeEventListener("mousemove", this._onKeyDownMousePositionHelper); |
@@ -5,5 +5,9 @@ export interface IDomEventListener { | ||
onMouseMove(event: MouseEvent): void; | ||
onMouseEnd(event: MouseEvent): void; | ||
onMouseUp(event: MouseEvent): void; | ||
onMouseOut(event: MouseEvent): void; | ||
onMouseWheel(event: WheelEvent): void; | ||
onTouchEnd(event: TouchEvent): void; | ||
onTouchUp(event: TouchEvent): void; | ||
onTouchCancel(event: TouchEvent): void; | ||
onTouchMove(event: TouchEvent): void; | ||
@@ -10,0 +14,0 @@ onTouchStart(event: TouchEvent): void; |
{ | ||
"name": "@shapediver/viewer.shared.services", | ||
"version": "1.14.13", | ||
"version": "1.14.14", | ||
"description": "", | ||
@@ -44,3 +44,3 @@ "keywords": [], | ||
"@shapediver/viewer.settings": "0.1.36", | ||
"@shapediver/viewer.shared.build-data": "1.14.13", | ||
"@shapediver/viewer.shared.build-data": "1.14.14", | ||
"@types/dompurify": "^2.3.1", | ||
@@ -56,3 +56,3 @@ "@types/ua-parser-js": "^0.7.36", | ||
}, | ||
"gitHead": "41fd9c3f68caaa5ff312b60372c077506885b17a" | ||
"gitHead": "68595016ee79a3452efb108ae66c7dff5c078ea0" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
210909
2738
+ Added@shapediver/viewer.shared.build-data@1.14.14(transitive)
- Removed@shapediver/viewer.shared.build-data@1.14.13(transitive)