Consider deprecating or updating $.mobile.media #4979

Closed
scottjehl opened this Issue Sep 11, 2012 · 1 comment

1 participant

@scottjehl

Including a polyfill for window.matchMedia might be handy to some users, but even if we keep it in jQM, our current $.mobile.media function doesn't defer to a native implementation, so it needs an update.

The latest in the matchMedia polyfill repo would be good to use. Or, if we don't need to expose this at all in jQM, maybe we should deprecate for later removal.

@scottjehl

Updating this to use native matchMedia when available (basically update it to this: https://github.com/paulirish/matchMedia.js/blob/master/matchMedia.js) could stand to improve our cold-start performance in newer platforms. @toddparker, @johnbender - sound good to you if I got ahead with this?

@scottjehl scottjehl pushed a commit that referenced this issue Sep 13, 2012
Scott Jehl updated our $.mobile.media function to use the matchMedia polyfill, w…
…hich defers to the native function where possible. $.mobile.media still returns a boolean as it always has, but now, window.matchMedia is exposed in unsupporting environments too, which gives developers access to its standard API that returns an object, and in native implementations, supports listeners as well (a polyfill is available for that part too). This addresses issue #4979
497b82a
@scottjehl scottjehl was assigned Sep 13, 2012
@scottjehl scottjehl closed this in 555e07a Nov 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment