aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/settings.coffee
diff options
context:
space:
mode:
authorJez Ng2012-10-29 17:56:32 -0400
committerJez Ng2012-10-29 18:28:33 -0400
commit76622cd99cf671531cfa21c5d6243f3e4e185116 (patch)
treebf0e1922a7f872ea044d3828f3b9e1fdcd67c1c8 /background_scripts/settings.coffee
parentc0af54eac713be14d1e3eceeca23139455abb408 (diff)
downloadvimium-76622cd99cf671531cfa21c5d6243f3e4e185116.tar.bz2
Convert strings to numbers when saving options page.
This avoids the need to continually re-parse the strings each time we load the option value.
Diffstat (limited to 'background_scripts/settings.coffee')
-rw-r--r--background_scripts/settings.coffee9
1 files changed, 6 insertions, 3 deletions
diff --git a/background_scripts/settings.coffee b/background_scripts/settings.coffee
index fc78d48f..2eb7c1d6 100644
--- a/background_scripts/settings.coffee
+++ b/background_scripts/settings.coffee
@@ -21,7 +21,7 @@ root.Settings = Settings =
# options/options.(coffee|html) only handle booleans and strings; therefore
# all defaults must be booleans or strings
defaults:
- scrollStepSize: "60"
+ scrollStepSize: 60
linkHintCharacters: "sadfjklewcmpgh"
linkHintNumbers: "0123456789"
filterLinkHints: false
@@ -62,6 +62,9 @@ root.Settings = Settings =
# default/fall back search engine
searchUrl: "http://www.google.com/search?q="
-# Initialization code.
-# We use this parameter to coordinate any necessary schema changes.
+ settingsVersion: Utils.getCurrentVersion()
+
+# We use settingsVersion to coordinate any necessary schema changes.
+if Utils.compareVersions("1.41", Settings.get("settingsVersion")) != -1
+ Settings.set("scrollStepSize", parseFloat Settings.get("scrollStepSize"))
Settings.set("settingsVersion", Utils.getCurrentVersion())