Skip to content

Commit

Permalink
Add document.createEvent for creating events in oldIE
Browse files Browse the repository at this point in the history
  • Loading branch information
drublic committed Jun 20, 2014
1 parent aa9c421 commit 20c9e1c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## HEAD
* Add document.createEvent for creating events in oldIE
* Make _injectStyles compatible with legacy browsers

## 1.1.6 - 06.06.2014
Expand Down
10 changes: 10 additions & 0 deletions modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@
if (global.bean) {
bean.fire(document, event, eventParams);

// Use createEvent if supported (that's mostly the case)
} else if (document.createEvent) {
eventTrigger = document.createEvent('CustomEvent');

eventTrigger.initCustomEvent(event, false, false, {
'modal': modal
});

document.dispatchEvent(eventTrigger);

// Use CustomEvents if supported
} else {
eventTrigger = new CustomEvent(event, eventParams);
Expand Down

0 comments on commit 20c9e1c

Please sign in to comment.