Integrate matchMedia to get support for AddListener and RemoveListener. #109

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@jameswestgate

Take advantage of response.js window.resize loop to add support for a media query list using regex based engine.

Initially wanted to add listener support to Paul's matchMedia.js . Tried a non-timer approach with among other things onpropertychanged / DOMAttrChanged, as well as the css3 transition end approach but realised fully xbrowser was going to need a timer. Didn't want to add another window.resize handler/timer and realised response.js was already:

i) using matchMedia.js
ii) watching window.resize

So I:

i) Moved matchMedia into response.js core, adding the AddListener and RemoveListener methods.
ii) Added the matchMedia media queries to the Rule array so that the listeners were fired instead of the style changes being applied.
iii) Added a feature detect in case there was support for media queries, but not matchMedia (IE9)
iv) Tested in IE6-9, latest Firefox, Safari, Chrome.

jameswestgate added some commits Feb 18, 2012

Integrate matchMedia to get support for AddListener and RemoveListener.
Take advantage of response.js window.resize loop to add support for a
media query list using regex based engine.
@beebs93

This comment has been minimized.

Show comment Hide comment
@beebs93

beebs93 May 10, 2012

Tested on IE7-9 and so far no problems. Nice update :)

beebs93 commented May 10, 2012

Tested on IE7-9 and so far no problems. Nice update :)

@tauren

This comment has been minimized.

Show comment Hide comment
@tauren

tauren Sep 19, 2012

+1
any chance this pull request can get added?

tauren commented Sep 19, 2012

+1
any chance this pull request can get added?

@davebeesleyarchived

This comment has been minimized.

Show comment Hide comment
@davebeesleyarchived

davebeesleyarchived Dec 3, 2012

+1
This is a brilliant integration. Not found a bug with it so far, but I am happily using media-queries in my IE JavaScript.

+1
This is a brilliant integration. Not found a bug with it so far, but I am happily using media-queries in my IE JavaScript.

@jefflembeck

This comment has been minimized.

Show comment Hide comment
@jefflembeck

jefflembeck Nov 20, 2013

Collaborator

Added a build option with the addListener polyfill included.

Collaborator

jefflembeck commented Nov 20, 2013

Added a build option with the addListener polyfill included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment