From e6424ce09d27f74608caf69472630537260692ed Mon Sep 17 00:00:00 2001 From: Phil Crosby Date: Wed, 9 Feb 2011 23:11:18 -0800 Subject: Re-center the help dialog when it gets taller after clicking "show advanced commands" --- helpDialog.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'helpDialog.html') 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(); -- cgit v1.2.3