Skip to content

Commit dd1d94d

Browse files
author
Kristján Oddsson
authored
Merge pull request #40 from github/event-construction
use `Event` constructor instead of `event.initEvent`
2 parents bf85407 + 07479ae commit dd1d94d

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

include-fragment-element.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ const privateData = new WeakMap()
44

55
function fire(name, target) {
66
setTimeout(function() {
7-
const event = target.ownerDocument.createEvent('Event')
8-
event.initEvent(name, false, false)
9-
target.dispatchEvent(event)
7+
target.dispatchEvent(new Event(name))
108
}, 0)
119
}
1210

0 commit comments

Comments
 (0)