aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2012-02-15 14:53:04 -0800
committerPhil Crosby2012-02-15 14:53:04 -0800
commit157bf9163166f9b8b8a78321cf69217cd1975f9c (patch)
tree870212d3681ae0ae2dbb71df964e0e5a2fb4397d
parenta21583edb4a7424ae03a4b7b7313999b04936a6b (diff)
downloadvimium-157bf9163166f9b8b8a78321cf69217cd1975f9c.tar.bz2
Fix the hudEnabled logic to work with the new settings framework.
-rw-r--r--background_page.html8
-rw-r--r--vimiumFrontend.js8
2 files changed, 6 insertions, 10 deletions
diff --git a/background_page.html b/background_page.html
index b6f277c3..fd7bdb82 100644
--- a/background_page.html
+++ b/background_page.html
@@ -738,14 +738,6 @@
open(chrome.extension.getURL('test_harnesses/automated.html'));
}
- /**
- * Determines wether the heads up display (HUD) is enabled or not.
- *
- * This value is configurable via the options page.
- */
- function hudEnabled() {
- return localStorage['hideHud'] !== "true";
- }
</script>
</head>
</html>
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 44ab1ab4..40efc5f1 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -1043,7 +1043,7 @@ HUD = {
},
show: function(text) {
- if (!hudEnabled()) return;
+ if (!HUD.enabled()) return;
clearTimeout(HUD._showForDurationTimerId);
HUD.displayElement().innerHTML = text;
clearInterval(HUD._tweenId);
@@ -1113,7 +1113,11 @@ HUD = {
this.isShowing = false;
},
- isReady: function() { return document.body != null; }
+ isReady: function() { return document.body != null; },
+
+ /* A preference which can be toggled in the Options page. */
+ enabled: function() { return settings.get("hideHud") !== "true"; }
+
};
Tween = {