mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
Only take parent into account if actually relevant to positioning.
This commit is contained in:
@@ -765,12 +765,15 @@ Guacamole.Mouse.State = function(x, y, left, middle, right, up, down) {
|
|||||||
parent = parent.offsetParent;
|
parent = parent.offsetParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Offset by document scroll amount
|
// Element ultimately depends on positioning within document body,
|
||||||
var documentScrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
|
// take document scroll into account.
|
||||||
var documentScrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
if (parent) {
|
||||||
|
var documentScrollLeft = document.body.scrollLeft || document.documentElement.scrollLeft;
|
||||||
|
var documentScrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
||||||
|
|
||||||
guac_state.x -= parent.offsetLeft - documentScrollLeft;
|
guac_state.x -= parent.offsetLeft - documentScrollLeft;
|
||||||
guac_state.y -= parent.offsetTop - documentScrollTop;
|
guac_state.y -= parent.offsetTop - documentScrollTop;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user