From 72ff4204655b8e87f7bdfbe8c9974376fbbc15a6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Wed, 13 Apr 2016 06:50:43 +0100 Subject: Add and for visual mode. Fixes #2092. --- lib/handler_stack.coffee | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib/handler_stack.coffee') diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee index c17be24f..806b707f 100644 --- a/lib/handler_stack.coffee +++ b/lib/handler_stack.coffee @@ -93,20 +93,21 @@ class HandlerStack @continueBubbling alwaysSuppressPropagation: (handler = null) -> - handler?() - @suppressPropagation + if handler?() == @suppressEvent then @suppressEvent else @suppressPropagation # Debugging. logResult: (eventNumber, type, event, handler, result) -> - label = - switch result - when @passEventToPage then "passEventToPage" - when @suppressPropagation then "suppressPropagation" - when @restartBubbling then "restartBubbling" - when "skip" then "skip" - when true then "continue" - label ||= if result then "continue/truthy" else "suppress" - console.log "#{eventNumber}", type, handler._name, label + if event?.type == "keydown" # Tweak this as needed. + label = + switch result + when @passEventToPage then "passEventToPage" + when @suppressEvent then "suppressEvent" + when @suppressPropagation then "suppressPropagation" + when @restartBubbling then "restartBubbling" + when "skip" then "skip" + when true then "continue" + label ||= if result then "continue/truthy" else "suppress" + console.log "#{eventNumber}", type, handler._name, label show: -> console.log "#{@eventNumber}:" -- cgit v1.2.3