diff options
| author | mrmr1993 | 2016-02-03 02:54:35 +0000 |
|---|---|---|
| committer | mrmr1993 | 2016-02-03 02:54:35 +0000 |
| commit | 94979f8e6b7f5efc51b1bcc380bf0f4fbcb6dfb8 (patch) | |
| tree | 3caf49ac73d6fc3b5f767bdd8ee512b8792e1de0 | |
| parent | 09e0570aeaf9a6d22a14f452206465a1db4bf3bd (diff) | |
| download | vimium-94979f8e6b7f5efc51b1bcc380bf0f4fbcb6dfb8.tar.bz2 | |
Move help dialog hide code into VimiumHelpDialog.hide
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 69113088..c554fde3 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -796,6 +796,11 @@ VimiumHelpDialog = # Simulating a click on the help dialog makes it the active element for scrolling. DomUtils.simulateClick document.getElementById "vimiumHelpDialog" + hide: -> + helpDialog = document.getElementById("vimiumHelpDialogContainer") + if (helpDialog) + helpDialog.parentNode.removeChild(helpDialog) + # # Advanced commands are hidden by default so they don't overwhelm new and casual users. # @@ -821,11 +826,8 @@ window.showHelpDialog = (html, fid) -> hideHelpDialog = (clickEvent) -> isShowingHelpDialog = false - helpDialog = document.getElementById("vimiumHelpDialogContainer") - if (helpDialog) - helpDialog.parentNode.removeChild(helpDialog) - if (clickEvent) - clickEvent.preventDefault() + VimiumHelpDialog.hide() + clickEvent?.preventDefault() toggleHelpDialog = (html, fid) -> if (isShowingHelpDialog) |
