codecomputerlove/PhotoSwipe — pull request #276 by jasonlcrane (2012-02-22 20:38:24+00:00)
Title: updates objectHasProperty to check for ('property' in object)

This change may solve some of the back button issues people are reporting. It did for us, in any case.

The "isBackEventSupported" check in photoswipe.class.js was returning false on browsers that clearly supported 'onhashchange'. Compatibility table here: http://caniuse.com/hashchange

Based on http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ it looks like the best way to check for actual event support is by checking for the property in the object, as in:

if ('onhashchange' in window) { // ...

Feedback appreciated.