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
1 changed files with 5 additions and 0 deletions

View File

@ -10,6 +10,11 @@ if typeof CustomEvent isnt 'function'
CustomEvent = (event, params) ->
evt = document.createEvent('CustomEvent')
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
CustomEvent.prototype = window.Event.prototype