From 674990c07422a61a702f14bfdaa8b3d2f3117f1b Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Wed, 3 Feb 2016 14:12:27 +0000 Subject: Move toggleHelpDialog to HelpDialog.toggle --- content_scripts/vimium_frontend.coffee | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 67742963..bcbc3574 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -137,7 +137,7 @@ initializePreDomReady = -> requestHandlers = showHUDforDuration: handleShowHUDforDuration - toggleHelpDialog: (request) -> if frameId == request.frameId then toggleHelpDialog request.dialogHtml + toggleHelpDialog: (request) -> if frameId == request.frameId then HelpDialog.toggle request.dialogHtml focusFrame: (request) -> if (frameId == request.frameId) then focusThisFrame request refreshCompletionKeys: refreshCompletionKeys getScrollPosition: -> scrollX: window.scrollX, scrollY: window.scrollY @@ -815,6 +815,9 @@ window.HelpDialog = HelpDialog.showing = false @container?.parentNode?.removeChild @container + toggle: (html) -> + if @showing then @hide() else @show html + # # Advanced commands are hidden by default so they don't overwhelm new and casual users. # @@ -832,12 +835,6 @@ window.HelpDialog = addOrRemove = if visible then "add" else "remove" HelpDialog.dialogElement.classList[addOrRemove] "showAdvanced" -toggleHelpDialog = (html) -> - if HelpDialog.showing - HelpDialog.hide() - else - HelpDialog.show html - initializePreDomReady() DomUtils.documentReady initializeOnDomReady DomUtils.documentReady registerFrame -- cgit v1.2.3