From 20ebbf3de2384738af916a441470d74a5aca14a3 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Fri, 2 Jan 2015 10:24:39 +0000 Subject: Modes; rework badge handling and fix passkeys mode. --- lib/handler_stack.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3