MCPcopy Create free account
hub / github.com/apache/cloudstack / attach

Method attach

systemvm/agent/noVNC/core/util/cursor.js:40–58  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 3

detachMethod · 0.95
clearMethod · 0.95
addEventListenerMethod · 0.80

Tested by

no test coverage detected