(target)
| 38 | } |
| 39 | |
| 40 | attach(target) { |
| 41 | if (this._target) { |
| 42 | this.detach(); |
| 43 | } |
| 44 | |
| 45 | this._target = target; |
| 46 | |
| 47 | if (useFallback) { |
| 48 | document.body.appendChild(this._canvas); |
| 49 | |
| 50 | const options = { capture: true, passive: true }; |
| 51 | this._target.addEventListener('mouseover', this._eventHandlers.mouseover, options); |
| 52 | this._target.addEventListener('mouseleave', this._eventHandlers.mouseleave, options); |
| 53 | this._target.addEventListener('mousemove', this._eventHandlers.mousemove, options); |
| 54 | this._target.addEventListener('mouseup', this._eventHandlers.mouseup, options); |
| 55 | } |
| 56 | |
| 57 | this.clear(); |
| 58 | } |
| 59 | |
| 60 | detach() { |
| 61 | if (!this._target) { |
nothing calls this directly
no test coverage detected