aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2010-03-07 18:29:20 -0800
committerPhil Crosby2010-03-07 22:50:32 -0800
commit25a813129b28a622ec17e139afedca8bc53305c8 (patch)
tree46953e171e37f8296beaa52b3ac2e1e6553c9377
parentc1a94a80815ea619ae01977c0e30e53113bb4a9e (diff)
downloadvimium-25a813129b28a622ec17e139afedca8bc53305c8.tar.bz2
Vertically center the help dialog.
-rw-r--r--helpDialog.html3
-rw-r--r--vimiumFrontend.js4
2 files changed, 5 insertions, 2 deletions
diff --git a/helpDialog.html b/helpDialog.html
index 652c2f91..c1fb4669 100644
--- a/helpDialog.html
+++ b/helpDialog.html
@@ -1,5 +1,5 @@
<!--
- This is show when typing "?". This HTML is loaded by the background page and then populated with the
+ This is shown when typing "?". This HTML is loaded by the background page and then populated with the
latest keybindings information before displaying.
-->
<div id="vimiumHelpDialog">
@@ -36,7 +36,6 @@
text-align:right;
font-weight:bold;
color:#2f508e;
- padding-right:4px;
white-space:nowrap;
}
.vimiumDivider {
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index a7dd263d..70ff77c6 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -499,6 +499,10 @@ function showHelpDialog(html) {
container.innerHTML = html;
container.getElementsByClassName("closeButton")[0].addEventListener("click", hideHelpDialog, false);
document.body.appendChild(container);
+ var dialog = document.getElementById("vimiumHelpDialog");
+ var zoomFactor = currentZoomLevel / 100.0;
+ dialog.style.top =
+ Math.max((window.innerHeight - dialog.clientHeight * zoomFactor) / 2.0, 20) / zoomFactor + "px";
}
function hideHelpDialog() {