mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
Reverted viewport fixes due to Android regression.
This commit is contained in:
@@ -57,20 +57,20 @@
|
||||
<!-- Keyboard event target for platforms with native OSKs -->
|
||||
<textarea id="eventTarget"></textarea>
|
||||
|
||||
<!-- Display -->
|
||||
<div id="display">
|
||||
|
||||
<!-- Menu trigger -->
|
||||
<div id="menuControl"></div>
|
||||
|
||||
<!-- Scrollable viewport -->
|
||||
<div id="viewport">
|
||||
|
||||
<!-- Display -->
|
||||
<div id="display"></div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- On-screen keyboard -->
|
||||
<div id="keyboardContainer"></div>
|
||||
|
||||
<!-- Dimensional clone of viewport -->
|
||||
<div id="viewportClone"/>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<div class="dialogOuter">
|
||||
<div class="dialogMiddle">
|
||||
|
@@ -23,7 +23,7 @@ var GuacamoleUI = {
|
||||
|
||||
/* UI Elements */
|
||||
|
||||
"viewport" : document.getElementById("viewport"),
|
||||
"viewport" : document.getElementById("viewportClone"),
|
||||
"display" : document.getElementById("display"),
|
||||
"menu" : document.getElementById("menu"),
|
||||
"menuControl" : document.getElementById("menuControl"),
|
||||
@@ -464,29 +464,34 @@ GuacamoleUI.attach = function(guac) {
|
||||
mouse.onmousedown = mouse.onmouseup = mouse.onmousemove =
|
||||
function(mouseState) {
|
||||
|
||||
// Get current viewport scroll
|
||||
var scroll_x = GuacamoleUI.viewport.scrollLeft;
|
||||
var scroll_y = GuacamoleUI.viewport.scrollTop;
|
||||
|
||||
// Determine mouse position within view
|
||||
var mouse_view_x = mouseState.x + guac_display.offsetLeft - scroll_x;
|
||||
var mouse_view_y = mouseState.y + guac_display.offsetTop - scroll_y;
|
||||
var mouse_view_x = mouseState.x + guac_display.offsetLeft - window.pageXOffset;
|
||||
var mouse_view_y = mouseState.y + guac_display.offsetTop - window.pageYOffset;
|
||||
|
||||
// Determine viewport dimensioins
|
||||
var view_width = GuacamoleUI.viewport.offsetWidth;
|
||||
var view_height = GuacamoleUI.viewport.offsetHeight;
|
||||
|
||||
// Scroll horizontally if necessary
|
||||
if (mouse_view_x > view_width)
|
||||
GuacamoleUI.viewport.scrollLeft += mouse_view_x - view_width;
|
||||
else if (mouse_view_x < 0)
|
||||
GuacamoleUI.viewport.scrollLeft += mouse_view_x;
|
||||
// Determine scroll amounts based on mouse position relative to document
|
||||
|
||||
// Scroll vertically if necessary
|
||||
var scroll_amount_x;
|
||||
if (mouse_view_x > view_width)
|
||||
scroll_amount_x = mouse_view_x - view_width;
|
||||
else if (mouse_view_x < 0)
|
||||
scroll_amount_x = mouse_view_x;
|
||||
else
|
||||
scroll_amount_x = 0;
|
||||
|
||||
var scroll_amount_y;
|
||||
if (mouse_view_y > view_height)
|
||||
GuacamoleUI.viewport.scrollTop += mouse_view_y - view_height;
|
||||
scroll_amount_y = mouse_view_y - view_height;
|
||||
else if (mouse_view_y < 0)
|
||||
GuacamoleUI.viewport.scrollTop += mouse_view_y;
|
||||
scroll_amount_y = mouse_view_y;
|
||||
else
|
||||
scroll_amount_y = 0;
|
||||
|
||||
// Scroll (if necessary) to keep mouse on screen.
|
||||
window.scrollBy(scroll_amount_x, scroll_amount_y);
|
||||
|
||||
// Send mouse event
|
||||
guac.sendMouseState(mouseState);
|
||||
|
@@ -47,7 +47,7 @@ div.dialogOuter {
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
|
||||
@@ -141,7 +141,7 @@ div.dialog p {
|
||||
/* Menu */
|
||||
|
||||
#menu {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
@@ -218,7 +218,7 @@ div#clipboardDiv textarea {
|
||||
}
|
||||
|
||||
div#menuControl {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
@@ -229,21 +229,23 @@ div#menuControl {
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
/* Viewport */
|
||||
/* Viewport Clone */
|
||||
|
||||
div#viewport {
|
||||
div#viewportClone {
|
||||
display: table;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
overflow: auto;
|
||||
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
/* Keyboard event target */
|
||||
|
||||
textarea#eventTarget {
|
||||
position: absolute;
|
||||
position: fixed;
|
||||
|
||||
/* Hide offscreen */
|
||||
left: 0;
|
||||
|
Reference in New Issue
Block a user