aboutsummaryrefslogtreecommitdiffstats
path: root/lib/handler_stack.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-01-02 10:24:39 +0000
committerStephen Blott2015-01-02 11:01:03 +0000
commit20ebbf3de2384738af916a441470d74a5aca14a3 (patch)
treeb477a0e03097e5368668dbe08a42e48dbd8db132 /lib/handler_stack.coffee
parentb5535bc5a1b44c12cff62bac601a8d6ec7e04a6c (diff)
downloadvimium-20ebbf3de2384738af916a441470d74a5aca14a3.tar.bz2
Modes; rework badge handling and fix passkeys mode.
Diffstat (limited to 'lib/handler_stack.coffee')
-rw-r--r--lib/handler_stack.coffee7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee
index 8929fa53..8de6ec12 100644
--- a/lib/handler_stack.coffee
+++ b/lib/handler_stack.coffee
@@ -26,7 +26,7 @@ class HandlerStack
@currentId = handler.id
passThrough = handler[type].call(@, event)
if not passThrough
- DomUtils.suppressEvent(event)
+ DomUtils.suppressEvent(event) if @isChromeEvent event
return false
# If the constant @passDirectlyToPage is returned, then discontinue further bubbling and pass the
# event through to the underlying page. The event is not suppresssed.
@@ -41,5 +41,10 @@ class HandlerStack
@stack.splice(i, 1)
break
+ # The handler stack handles chrome events (which may need to be suppressed) and internal (fake) events.
+ # This checks whether that the event at hand is a chrome event.
+ isChromeEvent: (event) ->
+ event?.preventDefault? and event?.stopImmediatePropagation?
+
root.HandlerStack = HandlerStack
root.handlerStack = new HandlerStack