aboutsummaryrefslogtreecommitdiffstats
path: root/vimiumFrontend.js
diff options
context:
space:
mode:
authorPhil Crosby2009-12-06 16:38:24 -0800
committerPhil Crosby2009-12-06 16:39:02 -0800
commit35ab4dbd630df9119b81852b6da9e8839dde45e5 (patch)
treedb58745203dbe211dbfa6da2b0813a07f3a99c06 /vimiumFrontend.js
parent2315488e86a01a46fed58773e610c74f0740bac6 (diff)
downloadvimium-35ab4dbd630df9119b81852b6da9e8839dde45e5.tar.bz2
Guard against trying to use the HUD prior to document.body being ready. Closes #25.
Diffstat (limited to 'vimiumFrontend.js')
-rw-r--r--vimiumFrontend.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 876164d2..31ac1e01 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -108,7 +108,8 @@ function saveZoomLevel(domain, zoomLevel) {
*/
function setPageZoomLevel(zoomLevel, showUINotification) {
document.documentElement.style.zoom = zoomLevel + "%";
- HUD.updatePageZoomLevel(zoomLevel);
+ if (document.body)
+ HUD.updatePageZoomLevel(zoomLevel);
if (showUINotification)
HUD.showForDuration("Zoom: " + currentZoomLevel + "%", 1000);
}
@@ -292,6 +293,10 @@ function exitFindMode() {
HUD.hide();
}
+/*
+ * A heads-up-display for showing Vimium page operations.
+ * Note: you cannot interact with the HUD until document.body is available.
+ */
HUD = {
showForDuration: function(text, duration) {
HUD.show(text);