1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Yuri S 2017-12-27 18:39:44 +05:00 committed by GitHub
parent 17ad4eb6fb
commit 049a3374aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,6 +10,11 @@ if typeof CustomEvent isnt 'function'
CustomEvent = (event, params) -> CustomEvent = (event, params) ->
evt = document.createEvent('CustomEvent') evt = document.createEvent('CustomEvent')
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail) evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail)
# IE does not set `defaultPrevented` when `preventDefault()` is called on CustomEvents
# http://stackoverflow.com/questions/23349191/event-preventdefault-is-not-working-in-ie-11-for-custom-events
evt.preventDefault = ->
Object.defineProperty this, 'defaultPrevented', get: ->
true
evt evt
CustomEvent.prototype = window.Event.prototype CustomEvent.prototype = window.Event.prototype