Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent bug if document.createEvent fails but window.addEventListener does not #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pariser
Copy link

@pariser pariser commented Dec 5, 2014

Some IE8 shims will provide certain capabilities and not others. In these capability checks, you're looking for window.addEventListener and then assuming that its existence will automatically give you the existence of document.createEvent. In the case where you are using both, I am explicitly checking for the existence of both.

I'm not sure if this project is being actively manned, but let me know if there's anything you want in order to merge. I used jsmin to create the .min.js files.

Don't assume that window.addEventListener capability gives us the
document.createEvent capability.

(Some IE shims, like aight.js, only define the former and not the
latter. In this case, timesheets.js assumes that the browser is
modern and then encounters a javascript error when it tries to
execute document.createEvent.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant