aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2011-02-09 23:11:18 -0800
committerPhil Crosby2011-02-09 23:13:06 -0800
commite6424ce09d27f74608caf69472630537260692ed (patch)
tree84865c4411fa6e3f955a3db47b87b5c2ad838c90
parenta036d2dac281b2528c2087b08839e118e3f449ae (diff)
downloadvimium-e6424ce09d27f74608caf69472630537260692ed.tar.bz2
Re-center the help dialog when it gets taller after clicking "show advanced commands"
-rw-r--r--helpDialog.html9
-rw-r--r--vimiumFrontend.js6
2 files changed, 9 insertions, 6 deletions
diff --git a/helpDialog.html b/helpDialog.html
index ae78d149..0f1cd6e9 100644
--- a/helpDialog.html
+++ b/helpDialog.html
@@ -27,6 +27,7 @@
margin-left:-320px;
top:50px;
-webkit-box-shadow: rgba(0, 0, 0, 0.4) 0px 0px 6px;
+ z-index:99999998;
}
#vimiumHelpDialog a { color:blue; }
#vimiumTitle, #vimiumTitle * { font-size:20px; }
@@ -140,6 +141,7 @@
this.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click",
VimiumHelpDialog.toggleAdvancedCommands, false);
this.showAdvancedCommands(this.advancedCommandsVisible);
+ this.centerDialog();
},
/*
@@ -151,6 +153,7 @@
chrome.extension.sendRequest({ handler: "saveHelpDialogSettings",
showAdvancedCommands: VimiumHelpDialog.advancedCommandsVisible });
VimiumHelpDialog.showAdvancedCommands(VimiumHelpDialog.advancedCommandsVisible);
+ VimiumHelpDialog.centerDialog();
},
showAdvancedCommands: function(visible) {
@@ -161,6 +164,12 @@
advanced[i].style.display = (visible ? "table-row" : "none");
},
+ centerDialog: function() {
+ var zoomFactor = currentZoomLevel / 100.0;
+ this.dialogElement.style.top = Math.max(
+ (window.innerHeight - this.dialogElement.clientHeight * zoomFactor) / 2.0,
+ 20) / zoomFactor + "px";
+ }
};
VimiumHelpDialog.init();
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index b7f9308f..b14e02cc 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -653,12 +653,6 @@ function showHelpDialog(html, fid) {
container.getElementsByClassName("closeButton")[0].addEventListener("click", hideHelpDialog, false);
container.getElementsByClassName("optionsPage")[0].addEventListener("click",
function() { chrome.extension.sendRequest({ handler: "openOptionsPageInNewTab" }); }, false);
-
- var dialog = document.getElementById("vimiumHelpDialog");
- dialog.style.zIndex = "99999998";
- var zoomFactor = currentZoomLevel / 100.0;
- dialog.style.top =
- Math.max((window.innerHeight - dialog.clientHeight * zoomFactor) / 2.0, 20) / zoomFactor + "px";
}
function hideHelpDialog(clickEvent) {