diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/handler_stack.coffee | 7 |
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 |
