Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Merge pull request #174 from arv/firefox-24-focus-event
Browse files Browse the repository at this point in the history
Fix Firefox 24 issue related to FocusEvent
  • Loading branch information
dfreedm committed Jun 18, 2013
2 parents e6e4c3a + f183806 commit 9e869f2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/wrappers/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,17 @@
GenericEvent.prototype = Object.create(SuperEvent.prototype);
if (prototype)
mixin(GenericEvent.prototype, prototype);
// Firefox does not support FocusEvent
// https://bugzilla.mozilla.org/show_bug.cgi?id=855741
if (OriginalEvent)
registerWrapper(OriginalEvent, GenericEvent, document.createEvent(name));
if (OriginalEvent) {
// IE does not support event constructors but FocusEvent can only be
// created using new FocusEvent in Firefox.
// https://bugzilla.mozilla.org/show_bug.cgi?id=882165
if (OriginalEvent.prototype['init' + name]) {
registerWrapper(OriginalEvent, GenericEvent,
document.createEvent(name));
} else {
registerWrapper(OriginalEvent, GenericEvent, new OriginalEvent('temp'));
}
}
return GenericEvent;
}

Expand Down

0 comments on commit 9e869f2

Please sign in to comment.