()
| 108 | } |
| 109 | |
| 110 | export 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 | } |
no test coverage detected