mirror of
https://github.com/kasmtech/KasmVNC.git
synced 2024-11-25 17:44:01 +01:00
Rename document.capturedElem to captureElement
To better fit most naming.
This commit is contained in:
parent
a8699ab8cb
commit
6067290169
@ -233,7 +233,7 @@ export default class Cursor {
|
||||
// When the cursor target has capture we want to show the cursor.
|
||||
// So, if a capture is active - look at the captured element instead.
|
||||
if (this._captureIsActive()) {
|
||||
target = document.capturedElem;
|
||||
target = document.captureElement;
|
||||
}
|
||||
if (this._shouldShowCursor(target)) {
|
||||
this._showCursor();
|
||||
@ -248,7 +248,7 @@ export default class Cursor {
|
||||
}
|
||||
|
||||
_captureIsActive() {
|
||||
return document.capturedElem &&
|
||||
document.documentElement.contains(document.capturedElem);
|
||||
return document.captureElement &&
|
||||
document.documentElement.contains(document.captureElement);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export function stopEvent(e) {
|
||||
// Emulate Element.setCapture() when not supported
|
||||
let _captureRecursion = false;
|
||||
let _elementForUnflushedEvents = null;
|
||||
document.capturedElem = null;
|
||||
document.captureElement = null;
|
||||
function _captureProxy(e) {
|
||||
// Recursion protection as we'll see our own event
|
||||
if (_captureRecursion) return;
|
||||
@ -31,8 +31,8 @@ function _captureProxy(e) {
|
||||
const newEv = new e.constructor(e.type, e);
|
||||
|
||||
_captureRecursion = true;
|
||||
if (document.capturedElem) {
|
||||
document.capturedElem.dispatchEvent(newEv);
|
||||
if (document.captureElement) {
|
||||
document.captureElement.dispatchEvent(newEv);
|
||||
} else {
|
||||
_elementForUnflushedEvents.dispatchEvent(newEv);
|
||||
}
|
||||
@ -55,7 +55,7 @@ function _captureProxy(e) {
|
||||
// Follow cursor style of target element
|
||||
function _capturedElemChanged() {
|
||||
const proxyElem = document.getElementById("noVNC_mouse_capture_elem");
|
||||
proxyElem.style.cursor = window.getComputedStyle(document.capturedElem).cursor;
|
||||
proxyElem.style.cursor = window.getComputedStyle(document.captureElement).cursor;
|
||||
}
|
||||
|
||||
const _captureObserver = new MutationObserver(_capturedElemChanged);
|
||||
@ -64,7 +64,7 @@ export function setCapture(target) {
|
||||
if (target.setCapture) {
|
||||
|
||||
target.setCapture();
|
||||
document.capturedElem = target;
|
||||
document.captureElement = target;
|
||||
|
||||
// IE releases capture on 'click' events which might not trigger
|
||||
target.addEventListener('mouseup', releaseCapture);
|
||||
@ -96,7 +96,7 @@ export function setCapture(target) {
|
||||
proxyElem.addEventListener('mouseup', _captureProxy);
|
||||
}
|
||||
|
||||
document.capturedElem = target;
|
||||
document.captureElement = target;
|
||||
|
||||
// Track cursor and get initial cursor
|
||||
_captureObserver.observe(target, {attributes: true});
|
||||
@ -115,10 +115,10 @@ export function releaseCapture() {
|
||||
if (document.releaseCapture) {
|
||||
|
||||
document.releaseCapture();
|
||||
document.capturedElem = null;
|
||||
document.captureElement = null;
|
||||
|
||||
} else {
|
||||
if (!document.capturedElem) {
|
||||
if (!document.captureElement) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -128,8 +128,8 @@ export function releaseCapture() {
|
||||
//
|
||||
// Before removing the capturedElem pointer we save it to a
|
||||
// temporary variable that the unflushed events can use.
|
||||
_elementForUnflushedEvents = document.capturedElem;
|
||||
document.capturedElem = null;
|
||||
_elementForUnflushedEvents = document.captureElement;
|
||||
document.captureElement = null;
|
||||
|
||||
_captureObserver.disconnect();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user