OpenAuth_server/views/shared/event.js
Fabian Stamm 51a8609880
All checks were successful
continuous-integration/drone/push Build is passing
Running prettier
2020-08-07 16:16:39 +02:00

13 lines
437 B
JavaScript

export default function fireEvent(element, event) {
if (document.createEventObject) {
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent("on" + event, evt);
} else {
// dispatch for firefox + others
var evt = document.createEvent("HTMLEvents");
evt.initEvent(event, true, true); // event type,bubbling,cancelable
return !element.dispatchEvent(evt);
}
}