aboutsummaryrefslogtreecommitdiffstats
path: root/options
diff options
context:
space:
mode:
authorCaleb Spare2012-08-22 15:19:29 -0700
committerCaleb Spare2012-08-22 15:19:29 -0700
commit9a538f875aa8de8c2cf602bf86ec6eaa4e40b939 (patch)
tree5152a10bee516c944f999a8219aa5faf5b1b8b36 /options
parent77e1f226003a696520b364650db20b308e4b71c0 (diff)
downloadvimium-9a538f875aa8de8c2cf602bf86ec6eaa4e40b939.tar.bz2
Prompt if exiting the options page with unsaved changes.
Fixes #549.
Diffstat (limited to 'options')
-rw-r--r--options/options.coffee3
1 files changed, 3 insertions, 0 deletions
diff --git a/options/options.coffee b/options/options.coffee
index 9f43defd..248750ca 100644
--- a/options/options.coffee
+++ b/options/options.coffee
@@ -28,6 +28,9 @@ document.addEventListener "DOMContentLoaded", ->
document.getElementById("restoreSettings").addEventListener "click", restoreToDefaults
document.getElementById("saveOptions").addEventListener "click", saveOptions
+window.onbeforeunload = ->
+ if $("saveOptions").disabled then null else "You have unsaved changes to options."
+
onOptionKeyup = (event) ->
if (event.target.getAttribute("type") isnt "checkbox" and
event.target.getAttribute("savedValue") isnt event.target.value)