class DetachableEasyPZ extends EasyPZ {
setupHostListeners() {
this.events = {
mousedown: this.onMouseDown.bind(this),
touchstart: this.onTouchStart.bind(this),
mousemove: this.onMouseMove.bind(this),
touchmove: this.onTouchMove.bind(this),
mouseup: this.onMouseUp.bind(this),
mouseout: this.onMouseOut.bind(this),
touchend: this.onTouchEnd.bind(this),
contextmenu: this.onContextMenu.bind(this),
wheel: this.onWheel.bind(this)
};
this.el.addEventListener('mousedown', this.events['mousedown']);
this.el.addEventListener('touchstart', this.events['touchstart']);
this.el.addEventListener('mousemove', this.events['mousemove']);
this.el.addEventListener('touchmove', this.events['touchmove']);
this.el.addEventListener('mouseup', this.events['mouseup']);
this.el.addEventListener('mouseout', this.events['mouseout']);
this.el.addEventListener('touchend', this.events['touchend']);
this.el.addEventListener('contextmenu', this.events['contextmenu']);
this.el.addEventListener('wheel', this.events['wheel']);
}
removeHostListeners() {
this.el.removeEventListener('mousedown', this.events['mousedown']);
this.el.removeEventListener('touchstart', this.events['touchstart']);
this.el.removeEventListener('mousemove', this.events['mousemove']);
this.el.removeEventListener('touchmove', this.events['touchmove']);
this.el.removeEventListener('mouseup', this.events['mouseup']);
this.el.removeEventListener('mouseout', this.events['mouseout']);
this.el.removeEventListener('touchend', this.events['touchend']);
this.el.removeEventListener('contextmenu', this.events['contextmenu']);
this.el.removeEventListener('wheel', this.events['wheel']);
}
}