From 3bae8f0f8fc012720001caced69999160d9005fa Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 2 Nov 2014 08:56:15 +0000 Subject: Centralize handling of event propagation. --- content_scripts/vimium_frontend.coffee | 6 +++--- content_scripts/vomnibar.coffee | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 93d0bcd2..8f4c0f2a 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -438,7 +438,7 @@ onKeydown = (event) -> handledKeydownEvents.push event else if (!modifiers) - event.stopImmediatePropagation() + DomUtils.suppressPropagation(event) handledKeydownEvents.push event else if (isShowingHelpDialog && KeyboardUtils.isEscape(event)) @@ -470,7 +470,7 @@ onKeydown = (event) -> if (keyChar == "" && !isInsertMode() && (currentCompletionKeys.indexOf(KeyboardUtils.getKeyChar(event)) != -1 || isValidFirstKey(KeyboardUtils.getKeyChar(event)))) - event.stopImmediatePropagation() + DomUtils.suppressPropagation(event) handledKeydownEvents.push event onKeyup = (event) -> @@ -486,7 +486,7 @@ onKeyup = (event) -> event.keyCode == keydown.keyCode handledKeydownEvents.splice i, 1 - event.stopImmediatePropagation() + DomUtils.suppressPropagation(event) break checkIfEnabledForUrl = -> diff --git a/content_scripts/vomnibar.coffee b/content_scripts/vomnibar.coffee index 8c6b2059..f1d2ccc5 100644 --- a/content_scripts/vomnibar.coffee +++ b/content_scripts/vomnibar.coffee @@ -139,7 +139,7 @@ class VomnibarUI @hide() # It seems like we have to manually suppress the event here and still return true. - event.stopImmediatePropagation() + DomUtils.suppressPropagation(event) event.preventDefault() true -- cgit v1.2.3