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

Function releaseCapture

systemvm/agent/noVNC/core/util/events.js:110–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108}
109
110export function releaseCapture() {
111 if (document.releaseCapture) {
112
113 document.releaseCapture();
114 document.captureElement = null;
115
116 } else {
117 if (!document.captureElement) {
118 return;
119 }
120
121 // There might be events already queued. The event proxy needs
122 // access to the captured element for these queued events.
123 // E.g. contextmenu (right-click) in Microsoft Edge
124 //
125 // Before removing the capturedElem pointer we save it to a
126 // temporary variable that the unflushed events can use.
127 _elementForUnflushedEvents = document.captureElement;
128 document.captureElement = null;
129
130 _captureObserver.disconnect();
131
132 const proxyElem = document.getElementById("noVNC_mouse_capture_elem");
133 proxyElem.style.display = "none";
134
135 window.removeEventListener('mousemove', _captureProxy);
136 window.removeEventListener('mouseup', _captureProxy);
137 }
138}

Callers 2

_captureProxyFunction · 0.85
setCaptureFunction · 0.85

Calls 2

removeEventListenerMethod · 0.80
disconnectMethod · 0.65

Tested by

no test coverage detected