diff options
| author | Caleb Spare | 2012-08-22 15:19:29 -0700 | 
|---|---|---|
| committer | Caleb Spare | 2012-08-22 15:19:29 -0700 | 
| commit | 9a538f875aa8de8c2cf602bf86ec6eaa4e40b939 (patch) | |
| tree | 5152a10bee516c944f999a8219aa5faf5b1b8b36 /options | |
| parent | 77e1f226003a696520b364650db20b308e4b71c0 (diff) | |
| download | vimium-9a538f875aa8de8c2cf602bf86ec6eaa4e40b939.tar.bz2 | |
Prompt if exiting the options page with unsaved changes.
Fixes #549.
Diffstat (limited to 'options')
| -rw-r--r-- | options/options.coffee | 3 | 
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) | 
