From 405eaf14d15a686a0a6b8178ffde51f9d0d4e1df Mon Sep 17 00:00:00 2001 From: Thomas Johansen Date: Tue, 28 Jul 2015 22:47:10 +0200 Subject: [PATCH] :see_no_evil: Add temporary hack to work around issue with CustomEvent Since it's no longer possible to "properly" extend CustomEvent, we will need to figure out a way to shadow the prototype chain, or some such. See https://code.google.com/p/chromium/issues/detail?id=495437 for more details. --- src/command-registry.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/command-registry.coffee b/src/command-registry.coffee index 14fd794e5..a2ceb1ad2 100644 --- a/src/command-registry.coffee +++ b/src/command-registry.coffee @@ -220,6 +220,7 @@ class CommandRegistry syntheticEvent = Object.create {}, eventPhase: value: Event.BUBBLING_PHASE currentTarget: get: -> currentTarget + target: value: currentTarget # TODO: Find a better way to solve this. preventDefault: value: -> originalEvent.preventDefault() stopPropagation: value: -> @@ -232,6 +233,7 @@ class CommandRegistry abortKeyBinding: value: -> originalEvent.abortKeyBinding?() # In Chrome 43, Object.create doesn't work well with CustomEvent. + # NOTE: We should "properly" shadow the prototype chain (CustomEvent + Event) here. for k, v of originalEvent when k not in syntheticEvent syntheticEvent[k] = v