From 94979f8e6b7f5efc51b1bcc380bf0f4fbcb6dfb8 Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 3 Feb 2016 02:54:35 +0000 Subject: Move help dialog hide code into VimiumHelpDialog.hide --- content_scripts/vimium_frontend.coffee | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'content_scripts') 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) -- cgit v1.2.3