unic / estatico

[DEPRECATED] Estático – Static site generator for frontend unicorns
Other
121 stars 18 forks source link

[Fix] Trigger 'mq' event on 'orientationchange' event #2

Closed d-simon closed 9 years ago

d-simon commented 9 years ago

On mobile devices (in this case iPhone6 – iOS 8.1.3) the resize event was not triggered by an orientation change, therefore the currentBreakpoint was not updated. This PR proposes to trigger the mq event on orientationchange.

backflip commented 9 years ago

Good catch, thanks a lot!

We'd prefer to combine this with the existing custom resize event, though (see comments). Would you like to update your commit (preferably squashing the result into a single commit) or do you want me to do it?

d-simon commented 9 years ago

Indeed, much simpler. :+1: I have squashed the commits.

backflip commented 9 years ago

Awesome! I will give this a quick look in our device lab and merge it after successful testing.

backflip commented 9 years ago

Hm, I can't reproduce this on iOS (7.0.4, 7.1.2, 8.1, 8.3) when testing http://unic.github.io/estatico/demo/modules/slideshow/slideshow.html

https://github.com/unic/estatico/blob/develop/source/demo/modules/slideshow/slideshow.js#L104 is triggered on rotate.

d-simon commented 9 years ago

Hm, me neither, anymore… I did some reading and it seems this change actually introduces a bug on android where the resizing hasn't happened yet, but the orientation-change is triggered before that. (Which can conflict with readings from window.innerWidth etc.) Sorry about that. Can be closed in that case.

web-development-test-01