mirror of
https://git.proxmox.com/git/mirror_novnc
synced 2025-08-10 14:32:52 +00:00
Add safety check in code for moving the handle
An element that has 'display: none' has a height of zero, and the logic for the handle assumed that this was never the case. This could cause the handle to end up at the wrong coordinates.
This commit is contained in:
parent
59cd99bc38
commit
f75e4d3caa
@ -556,6 +556,11 @@ var UI;
|
|||||||
.getBoundingClientRect();
|
.getBoundingClientRect();
|
||||||
var margin = 10;
|
var margin = 10;
|
||||||
|
|
||||||
|
// These heights need to be non-zero for the below logic to work
|
||||||
|
if (handleHeight === 0 || controlbarBounds.height === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var newY = viewportRelativeY;
|
var newY = viewportRelativeY;
|
||||||
|
|
||||||
// Check if the coordinates are outside the control bar
|
// Check if the coordinates are outside the control bar
|
||||||
|
Loading…
Reference in New Issue
Block a user