Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX] Fixed menu looks buggy when scrolling (Podio bug_25) (#52)
* [REFACTOR] Simplifying. No need to check hasClass before using removeClass. * [REFACTOR] Simplying. First of all html.mobile-menu-class is already removed earlier in function, so no need to check again. Secondly it both checks isAndroid and not isAndroid which makes both states unnecessary. * [FIX] Bootstrap medium devices starts from 992px width and upwards. * [FIX] Replacing screen.width and jQuery(window).width with window.matchMedia. - First of all screen.width is problematic since on computers it will report the screen, not the window. - Also window.matchMedia will report the same value as Bootstrap lives after independent if the scrollbar is floating over the window (most mobiles) or next to it (most desktops). jQuery(window) reports a different value which will not always work. * [REFACTOR] Make calcOffsetTop its own function (similar to cleanup). * [REFACTOR] Simplifying. addClass only adds class if necessary anyway. * [FIX] Change from orientationchange to matchMedia. This listener will fire also when a tablet or similar is rotated and crosses the 992 pixel window-width border (which is the important part - not the orientation).
- Loading branch information