mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
🙈 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.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user