From b6a0cc82d138dd67a77d8e3298c6f56362e729be Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 4 Feb 2016 07:54:47 +0000 Subject: Revert "Tweaks to #1966." This reverts commit 4874362d8f14d2cdf712a4c01ac756f2dd6f6e4c. --- content_scripts/vimium_frontend.coffee | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index ef11d450..bcbc3574 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -774,7 +774,7 @@ window.HelpDialog = showing: false # This setting is pulled out of local storage. It's false by default. - getShowAdvancedCommands: -> Settings.get "helpDialog_showAdvancedCommands" + getShowAdvancedCommands: -> Settings.get("helpDialog_showAdvancedCommands") init: -> return if @container? @@ -792,7 +792,7 @@ window.HelpDialog = false) @dialogElement.getElementsByClassName("optionsPage")[0].addEventListener("click", (clickEvent) -> clickEvent.preventDefault() - chrome.runtime.sendMessage {handler: "openOptionsPageInNewTab"} + chrome.runtime.sendMessage({handler: "openOptionsPageInNewTab"}) false) @dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].addEventListener("click", HelpDialog.toggleAdvancedCommands, false) @@ -800,19 +800,19 @@ window.HelpDialog = isReady: -> document.body? and @container? show: (html) -> - return if @showing or !@isReady() - @showing = true + return if HelpDialog.showing or !@isReady() + HelpDialog.showing = true for placeholder, htmlString of html @dialogElement.querySelector("#help-dialog-#{placeholder}").innerHTML = htmlString document.body.appendChild @container - @showAdvancedCommands @getShowAdvancedCommands() + @showAdvancedCommands(@getShowAdvancedCommands()) # Simulating a click on the help dialog makes it the active element for scrolling. DomUtils.simulateClick document.getElementById "vimiumHelpDialog" hide: -> - @showing = false + HelpDialog.showing = false @container?.parentNode?.removeChild @container toggle: (html) -> @@ -824,16 +824,16 @@ window.HelpDialog = toggleAdvancedCommands: (event) -> event.preventDefault() showAdvanced = HelpDialog.getShowAdvancedCommands() - HelpDialog.showAdvancedCommands !showAdvanced + HelpDialog.showAdvancedCommands(!showAdvanced) Settings.set("helpDialog_showAdvancedCommands", !showAdvanced) showAdvancedCommands: (visible) -> - @dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML = + HelpDialog.dialogElement.getElementsByClassName("toggleAdvancedCommands")[0].innerHTML = if visible then "Hide advanced commands" else "Show advanced commands" # Add/remove the showAdvanced class to show/hide advanced commands. addOrRemove = if visible then "add" else "remove" - @dialogElement.classList[addOrRemove] "showAdvanced" + HelpDialog.dialogElement.classList[addOrRemove] "showAdvanced" initializePreDomReady() DomUtils.documentReady initializeOnDomReady -- cgit v1.2.3