未验证 提交 049a3374 编写于 作者: Y Yuri S 提交者: GitHub
上级 17ad4eb6
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册