Automatically reposition event target on scroll.

This commit is contained in:
Michael Jumper
2012-04-08 16:24:52 -07:00
parent 14ec0db8de
commit a3f411c126
2 changed files with 11 additions and 4 deletions

View File

@@ -447,6 +447,12 @@ var GuacamoleUI = {
GuacamoleUI.eventTarget.setAttribute("autocorrect", "off");
GuacamoleUI.eventTarget.setAttribute("autocapitalize", "off");
// Automatically reposition event target on scroll
window.addEventListener("scroll", function() {
GuacamoleUI.eventTarget.style.left = window.pageXOffset + "px";
GuacamoleUI.eventTarget.style.top = window.pageYOffset + "px";
});
})();
// Tie UI events / behavior to a specific Guacamole client

View File

@@ -245,15 +245,16 @@ div#viewportClone {
/* Keyboard event target */
textarea#eventTarget {
position: fixed;
position: absolute;
/* Hide offscreen */
left: 0;
top: 0;
width: 0;
height: 0;
opacity: 0;
width: 10px;
height: 10px;
opacity: 1;
z-index: 100;
overflow: hidden;
}