Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol authored and avantika-gupta-jtg committed May 14, 2020
1 parent 7e5b228 commit 0eed89d
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
var el = this[0],
event;

if (el.dispatchEvent) {
if (el.dispatchEvent) { // for modern browsers & IE9+
if (typeof Event === 'function') {
// For modern browsers
event = new Event(eventName, {
Expand All @@ -155,13 +155,12 @@
}

el.dispatchEvent(event);
} else if (el.fireEvent) { // for IE8
event = document.createEventObject();
event.eventType = eventName;
el.fireEvent('on' + eventName, event);
} else {
if (el.fireEvent) {
event = document.createEventObject();
event.eventType = eventName;
el.fireEvent('on' + eventName, event);
}

// fall back to jQuery.trigger
this.trigger(eventName);
}
};
Expand Down

0 comments on commit 0eed89d

Please sign in to comment.