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

window.addListener() #2037

Open
BlackMagic opened this Issue Oct 16, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@BlackMagic

Should this be covered? It is used with window.matchMedia(), which is covered.

@Fyrd

This comment has been minimized.

Show comment
Hide comment
@Fyrd

Fyrd Oct 17, 2015

Owner

I assume this should be MediaQueryList.addListener(), then?

Owner

Fyrd commented Oct 17, 2015

I assume this should be MediaQueryList.addListener(), then?

@BlackMagic

This comment has been minimized.

Show comment
Hide comment
@BlackMagic

BlackMagic Oct 17, 2015

I'm not sure. I'm not an expert in this area. This source
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListListener doesn't
refer to it specifically, and is more than vague about browser support
for |MediaQueryList|.

addListener() is associated with Window.matchMedia(), described here
https://developer.mozilla.org/en/docs/Web/API/Window/matchMedia. The
way I use addListener() is as follows:

var mql = window.matchMedia('(min-width : 990px)');

mql.addListener(/callback_function_name/);

matchMedia appears on caniuse http://caniuse.com/#search=matchMedia,
but addListener doesn't. Since addListener is an important element in
setting up media queries in Javascript I though it should be mentioned.

It works in any browser that supports matchMedia. I have used it to
build a lightweight Javascript media query manager.

On 17/10/2015 2:39 PM, Alexis Deveria wrote:

I assume this should be |MediaQueryList.addListener()|, then?


Reply to this email directly or view it on GitHub
#2037 (comment).

I'm not sure. I'm not an expert in this area. This source
https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryListListener doesn't
refer to it specifically, and is more than vague about browser support
for |MediaQueryList|.

addListener() is associated with Window.matchMedia(), described here
https://developer.mozilla.org/en/docs/Web/API/Window/matchMedia. The
way I use addListener() is as follows:

var mql = window.matchMedia('(min-width : 990px)');

mql.addListener(/callback_function_name/);

matchMedia appears on caniuse http://caniuse.com/#search=matchMedia,
but addListener doesn't. Since addListener is an important element in
setting up media queries in Javascript I though it should be mentioned.

It works in any browser that supports matchMedia. I have used it to
build a lightweight Javascript media query manager.

On 17/10/2015 2:39 PM, Alexis Deveria wrote:

I assume this should be |MediaQueryList.addListener()|, then?


Reply to this email directly or view it on GitHub
#2037 (comment).

@BlackMagic

This comment has been minimized.

Show comment
Hide comment
@BlackMagic

BlackMagic Oct 26, 2015

img_5372
img_5370

While I think of it, iOS9 has dropped support for flexbox. canIuse shows
flexbox as being supported on iOS9.

Flexbox is supported on iOS8 and OSX, but not on iOS9. I've reported the
issue to Apple in Australia.

I'm attaching 2 screenshots taken on an iPhone to illustrate the problem.

On 17/10/2015 2:39 PM, Alexis Deveria wrote:

I assume this should be |MediaQueryList.addListener()|, then?


Reply to this email directly or view it on GitHub
#2037 (comment).

img_5372
img_5370

While I think of it, iOS9 has dropped support for flexbox. canIuse shows
flexbox as being supported on iOS9.

Flexbox is supported on iOS8 and OSX, but not on iOS9. I've reported the
issue to Apple in Australia.

I'm attaching 2 screenshots taken on an iPhone to illustrate the problem.

On 17/10/2015 2:39 PM, Alexis Deveria wrote:

I assume this should be |MediaQueryList.addListener()|, then?


Reply to this email directly or view it on GitHub
#2037 (comment).

@BlackMagic

This comment has been minimized.

Show comment
Hide comment
@BlackMagic

BlackMagic Oct 27, 2015

Another discovery I made today is that Opera Mini supports the JavaScript matchMedia API, including event listeners, contrary to what appears on the caniuse website at http://caniuse.com/#search=matchMedia

I tested Opera Mini and Opera Mini beta 5.2 on an android tablet against a website that uses matchMedia and it worked fine.

Another discovery I made today is that Opera Mini supports the JavaScript matchMedia API, including event listeners, contrary to what appears on the caniuse website at http://caniuse.com/#search=matchMedia

I tested Opera Mini and Opera Mini beta 5.2 on an android tablet against a website that uses matchMedia and it worked fine.

@adamschwartz

This comment has been minimized.

Show comment
Hide comment

👍

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