rikschennink / conditioner

💆🏻 Frizz free, context-aware, JavaScript modules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Media monitor and <=IE9

awolkers opened this issue · comments

The monitor for the media query does not work when you resize the browser in IE9. On load the check works fine. This problem also occurs on the example file shown on your site.

In IE8 the check doesn't work at all. I'm using the same shims that worked fine with older version of conditioner.

I'm using the following condition:
data-conditions="media:{(max-width:47.9375em)} or not media:{supported}"

commented

Thanks, will take a look at this as soon as possible.

I have an issue that is likely related. In IE9 I get a JavaScript error: Object doesn't support property or method 'matchMedia'. The origin is conditionerjs/monitors/media.js.

I've looked at some of the differences between the latest version of Conditioner and mine, and I see you've updated your shim folder (https://github.com/rikschennink/conditioner/tree/gh-pages/js/shim) with a couple of matchMedia polyfills, so I think those are intended to fix this issue? I'll give them a try to see if it resolves the problem. Probably can ignore my comment then :)

commented

@lpullersma yeah, it seems like those errors originate from missing (or faulty) shims.

@rikschennink Yeah, the shims from your repository did the trick. Also noteworthy that the order in which the shims are included is important. (maybe a superfluous remark, but something I had overlooked :) )
Anyway, I don't think this will resolve the issue of @awolkers, but I haven't tested that particulair issue myself.

@rikschennink I ran into this problem again for a new project I am working on. I updated your matchmedia polyfills with these ones and it worked. https://github.com/paulirish/matchMedia.js
Seems like your polyfill was outdated. Did not tested this in IE8 but only IE9

commented

Alright, that's excellent news. Closing the issue.