aboutsummaryrefslogtreecommitdiffstats
path: root/pages/options.coffee
diff options
context:
space:
mode:
authorStephen Blott2017-10-29 09:11:17 +0000
committerStephen Blott2017-10-29 09:11:19 +0000
commitf40a0e697c6d4f88bc4ccd410951339f86a609d6 (patch)
tree9d06559a773fbbb8f1ceefb159f18fac00a97366 /pages/options.coffee
parent93e37ee633e86a3af3e7a583ccbcab0c4e5cfce3 (diff)
downloadvimium-f40a0e697c6d4f88bc4ccd410951339f86a609d6.tar.bz2
Fix backup link for FF and Chrome.
This makes the UI for generating an options backup the same for FF and Chrome. We populate the *Backup* link on `mousedown`.
Diffstat (limited to 'pages/options.coffee')
-rw-r--r--pages/options.coffee11
1 files changed, 3 insertions, 8 deletions
diff --git a/pages/options.coffee b/pages/options.coffee
index a6916d43..83c96339 100644
--- a/pages/options.coffee
+++ b/pages/options.coffee
@@ -333,8 +333,7 @@ document.addEventListener "DOMContentLoaded", ->
#
# Backup and restore. "?" is for the tests."
DomUtils?.documentReady ->
- $("backupButton").addEventListener "click", ->
- document.activeElement?.blur()
+ populateBackupLinkUrl = ->
backup = settingsVersion: bgSettings.get "settingsVersion"
for option in Option.all
backup[option.field] = option.readValueFromElement()
@@ -344,12 +343,8 @@ DomUtils?.documentReady ->
url = bgWin.URL.createObjectURL blob
a = $ "backupLink"
a.href = url
- if Utils.isFirefox()
- # On Firefox, the user has to click the link manually.
- a.style.display = ""
- a.textContent = "Click to download backup"
- else
- a.click()
+
+ $("backupLink").addEventListener "mousedown", populateBackupLinkUrl, true
$("chooseFile").addEventListener "change", (event) ->
document.activeElement?.blur()