aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
authorMatt Garriott2012-08-25 19:07:25 -0600
committerMatt Garriott2012-08-25 19:07:25 -0600
commit4ec5cc6fcaaac22826b3e0535282733a2368d1e4 (patch)
tree36964e41fbae183bbf9edc4efa74c32a9cee035e /content_scripts/vimium_frontend.coffee
parentbebb767410db71e6cd493a7fe09a0aba4c4613a2 (diff)
downloadvimium-4ec5cc6fcaaac22826b3e0535282733a2368d1e4.tar.bz2
The help dialog will now properly read the user's preference for showing advanced commands.
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee12
1 files changed, 6 insertions, 6 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 548e9c6c..9accaa3b 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -854,25 +854,25 @@ window.showHelpDialog = (html, fid) ->
# scripts.forEach((script) -> eval(script.text))
VimiumHelpDialog =
# This setting is pulled out of local storage. It's false by default.
- advancedCommandsVisible: false
#chrome.extension.getBackgroundPage().Settings.get('helpDialog_showAdvancedCommands')
+ getShowAdvancedCommands: (callback) ->
+ chrome.extension.sendRequest({ handler: "getShowAdvancedCommands"}, callback)
init: () ->
this.dialogElement = document.getElementById("vimiumHelpDialog")
this.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click",
VimiumHelpDialog.toggleAdvancedCommands, false)
this.dialogElement.style.maxHeight = window.innerHeight - 80
- this.showAdvancedCommands(this.advancedCommandsVisible)
+ this.getShowAdvancedCommands(this.showAdvancedCommands)
#
# Advanced commands are hidden by default so they don't overwhelm new and casual users.
#
toggleAdvancedCommands: (event) ->
event.preventDefault()
- VimiumHelpDialog.advancedCommandsVisible = !VimiumHelpDialog.advancedCommandsVisible
- chrome.extension.sendRequest(
- { handler: "saveHelpDialogSettings", showAdvancedCommands: VimiumHelpDialog.advancedCommandsVisible })
- VimiumHelpDialog.showAdvancedCommands(VimiumHelpDialog.advancedCommandsVisible)
+ VimiumHelpDialog.getShowAdvancedCommands((value) ->
+ VimiumHelpDialog.showAdvancedCommands(!value)
+ chrome.extension.sendRequest({ handler: "saveHelpDialogSettings", showAdvancedCommands: !value }))
showAdvancedCommands: (visible) ->
VimiumHelpDialog.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML =