mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-04-29 10:24:45 +00:00
Fix for Issue 811 - All resolution breakpoint classes added to <html> element, throws off label and form element flow on narrow screens.
- We were firing off our fake orientationchange event before the viewport meta tag is injected. This causes us to get the default document width for the device which is much wider than the actual device-width. We now fire off the event after the dom ready event fires.
This commit is contained in:
parent
5b4c23b67d
commit
cd344f0440
1 changed files with 7 additions and 0 deletions
|
|
@ -101,7 +101,14 @@ $(document).bind("mobileinit.htmlclass", function(){
|
|||
//add classes to HTML element for min/max breakpoints
|
||||
detectResolutionBreakpoints();
|
||||
});
|
||||
});
|
||||
|
||||
/* Manually trigger an orientationchange event when the dom ready event fires.
|
||||
This will ensure that any viewport meta tag that may have been injected
|
||||
has taken effect already, allowing us to properly calculate the width of the
|
||||
document.
|
||||
*/
|
||||
$(function(){
|
||||
//trigger event manually
|
||||
$window.trigger( "orientationchange.htmlclass" );
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue