diff options
| author | Stephen Blott | 2016-04-18 10:28:22 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2016-04-18 10:28:25 +0100 | 
| commit | 20c1fef75eef7a203cc550f2d035ee5c82be5bd6 (patch) | |
| tree | bcc52c4f36af7f00ad1adb94526ba9e8d7b29ee6 /content_scripts/hud.coffee | |
| parent | 61e94c77d37011f675478c95b33ccd1dcf70ca6d (diff) | |
| download | vimium-20c1fef75eef7a203cc550f2d035ee5c82be5bd6.tar.bz2 | |
Simplify find-mode exit event.
Previously, we were transferring a "transferable event" from the HUD UI
component to the content script (when find mode exits).
In addition to being unnecessary, this was triggering a warning in the
console because we were reading *all* of the events keys, including one
which triggers a "this is being deprecated" warning.
The approach here is simpler, transfers less data and avoids triggering
the warning.
Diffstat (limited to 'content_scripts/hud.coffee')
| -rw-r--r-- | content_scripts/hud.coffee | 9 | 
1 files changed, 4 insertions, 5 deletions
diff --git a/content_scripts/hud.coffee b/content_scripts/hud.coffee index 4ba8557c..0d3a6f95 100644 --- a/content_scripts/hud.coffee +++ b/content_scripts/hud.coffee @@ -53,7 +53,8 @@ HUD =        else          @tween.fade 0, 150, => @hide true, updateIndicator -  hideFindMode: (data) -> +  # These parameters describe the reason find mode is exiting, and come from the HUD UI component. +  hideFindMode: ({exitEventIsEnter, exitEventIsEscape}) ->      @findMode.checkReturnToViewPort()      # An element won't receive a focus event if the search landed on it while we were in the HUD iframe. To @@ -65,13 +66,11 @@ HUD =      document.activeElement?.blur()      focusNode?.focus() -    {event} = data - -    if event.keyCode == keyCodes.enter +    if exitEventIsEnter        handleEnterForFindMode()        if FindMode.query.hasResults          postExit = -> new PostFindMode -    else if KeyboardUtils.isEscape event +    else if exitEventIsEscape        # We don't want FindMode to handle the click events that handleEscapeForFindMode can generate, so we        # wait until the mode is closed before running it.        postExit = handleEscapeForFindMode  | 
