Commit 18fa1fd9 authored by scottjehl's avatar scottjehl

Getting window dimensions currently fails in Nokia browsers, causing JS error...

Getting window dimensions currently fails in Nokia browsers, causing JS error (and consequently making jQuery Mobile fail to render the page). Based on a tip from Ben Nolan, this fix returns window.screen[width|height] if the other  attempts at getting window dimensions fail. On mobile at least, it seems to make sense, and on desktop (assuming this issue would ever show up on desktop), this might be better than returning false or undefined.
parent 291b1edf
......@@ -36,7 +36,7 @@ jQuery.each([ "Height", "Width" ], function( i, name ) {
if ( jQuery.isWindow( elem ) ) {
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
return elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
elem.document.body[ "client" + name ];
elem.document.body[ "client" + name ] || window.screen && window.screen[ name ];
// Get document width or height
} else if ( elem.nodeType === 9 ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment