   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) ->

  toggleAdvancedCommands: (event) ->
    event.preventDefault()
    showAdvanced = HelpDialog.getShowAdvancedCommands()
    HelpDialog.showAdvancedCommands !showAdvanced
    Settings.set("helpDialog_showAdvancedCommands", !showAdvanced)

  showAdvancedCommands: (visible) ->
    @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"

initializePreDomReady()
DomUtils.documentReady initializeOnDomReady

  showing: false

  # This setting is pulled out of local storage. It's false by default.
  getShowAdvancedCommands: -> Settings.get("helpDialog_showAdvancedCommands")

  init: ->
    return if @container?
