filamentgroup / Overthrow

A tiny, no-frills, framework-independent, targeted overflow: auto polyfill for use in responsive design.
MIT License
906 stars 94 forks source link

Update overthrow-polyfill.js #74

Closed zanedev closed 1 year ago

zanedev commented 10 years ago

We were seeing a random error in newrelic logs about target not being available. Changed this to check for target before trying to accessing a property of it.

jylauril commented 10 years ago

The original code for that return statement is very sloppy, as it doesn't check the existence of the target parameter in either of the clauses. This pull request fixes the issue of it not existing, but introduces another problem when it doesn't return the target property as last condition of that clause.

Personally I would open up the whole clause to a more readable code block rather than try to cram it all into one line, but I think this would be the proper fix for that particular problem:

return !ascend && target && (target.className && target.className.indexOf(scrollIndicatorClassName) > -1 && target || o.closest(target.parentNode));
zanedev commented 8 years ago

Don't think they care lol closing

zachleat commented 8 years ago

Don’t confuse not caring with not having the time to review this one quite yet, gonna leave it open for now if that’s ok with you all