Provide explicit means of exiting panning mode (fixes #223).

This commit is contained in:
Michael Jumper
2012-11-28 21:26:20 -08:00
parent 1a8cede4b2
commit 0576ed3dcc
2 changed files with 31 additions and 0 deletions

View File

@@ -255,6 +255,18 @@ GuacUI.Client.PanOverlay = function() {
GuacUI.createChildElement(pan_overlay, "div", "indicator right");
GuacUI.createChildElement(pan_overlay, "div", "indicator left");
/*
* Add exit button
*/
var back = GuacUI.createChildElement(pan_overlay, "p", "hint");
back.textContent = "Tap here to exit panning mode";
// Return to interactive when back is clicked
back.addEventListener("click", function() {
GuacUI.StateManager.setState(GuacUI.Client.states.INTERACTIVE);
}, false);
this.show = function() {
document.body.appendChild(pan_overlay);
};

View File

@@ -263,3 +263,22 @@ div#viewportClone {
color: #D44;
}
p.hint {
border: 0.25em solid rgba(255, 255, 255, 0.25);
background: black;
opacity: 0.75;
color: white;
max-width: 10em;
padding: 1em;
margin: 1em;
position: absolute;
left: 0;
top: 0;
box-shadow: 0.25em 0.25em 0.25em rgba(0, 0, 0, 0.75);
}