jonathantneal / flexibility

A JavaScript polyfill for Flexbox
https://jonathantneal.github.io/flexibility/
MIT License
4.33k stars 479 forks source link

Fix ie detect.js remove, fixes #55 bug #58

Closed chyngyz closed 8 years ago

chyngyz commented 8 years ago

ieVersion() returns false for non-ie browsers, thus if (!flexibility.detect() || ieVersion() <= 9) becomes true and document.attachEvent gives Uncaught TypeError: document.attachEvent is not a function error. It should be if (!flexibility.detect() && ieVersion() <= 9), I guess ) Tested in IE8-9, tests work fine.

nucab commented 8 years ago

Thanks!

jonathantneal commented 8 years ago

I’m not including detection in v2 at this time. I’m open to including it, but I recommend folks use Modernizr or their own detection. Think I should change this? We can open a new issue.

https://github.com/jonathantneal/flexibility/blob/master/SUPPORT.md#detecting-flexbox-support

Dan503 commented 8 years ago

Nah I think using modernizr for the detection is the best way to do it. No need to add extra weight to handle detection when modern browsers shouldn't be loading the script at all in the first place.

Dan503 commented 8 years ago

Is there a reason you haven't built the window resize functionality you have documented in the support md file into the main script itself?

If there aren't any common problems that occur from the window resize script, it should just be applied by default.