Skip to content

Commit a95cb79

Browse files
committed
Made browser sniff for BlackBerry 6 or lesser a little less gross, if that’s even possible.
1 parent 14fc9fc commit a95cb79

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

js/jquery.mobile.fixedToolbar.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
2626
// The following function serves to rule out some popular browsers with known fixed-positioning issues
2727
// This is a plugin option like any other, so feel free to improve or overwrite it
2828
supportBlacklist: function(){
29-
var ua = navigator.userAgent,
29+
var w = window,
30+
ua = navigator.userAgent,
3031
platform = navigator.platform,
3132
// Rendering engine is Webkit, and capture major version
3233
wkmatch = ua.match( /AppleWebKit\/([0-9]+)/ ),
3334
wkversion = !!wkmatch && wkmatch[ 1 ],
3435
ffmatch = ua.match( /Fennec\/([0-9]+)/ ),
3536
ffversion = !!ffmatch && ffmatch[ 1 ],
3637
operammobilematch = ua.match( /Opera Mobile\/([0-9]+)/ ),
37-
omversion = !!operammobilematch && operammobilematch[ 1 ],
38-
w = window;
39-
38+
bbmatch = w.blackberry && w.navigator.appVersion.match( /Version\/([0-9]+)/ ),
39+
bbversion = !!bbmatch && parseInt( bbmatch[ 1 ], 10 ),
40+
omversion = !!operammobilematch && operammobilematch[ 1 ];
41+
4042
if(
4143
// iOS 4.3 and older : Platform is iPhone/Pad/Touch and Webkit version is less than 534 (ios5)
4244
( ( platform.indexOf( "iPhone" ) > -1 || platform.indexOf( "iPad" ) > -1 || platform.indexOf( "iPod" ) > -1 ) && wkversion && wkversion < 534 )
@@ -56,7 +58,7 @@ define( [ "jquery", "./jquery.mobile.widget", "./jquery.mobile.core", "./jquery.
5658
( "palmGetResource" in window && wkversion && wkversion < 534 )
5759
||
5860
// BlackBerry six and below.
59-
( w.blackberry && ( w.navigator.appVersion.match( /Version\/([0-9])/ ) && parseInt( RegExp.$1, 10 ) < 7 ) )
61+
( w.blackberry && bbversion < 7 )
6062
||
6163
// MeeGo
6264
( ua.indexOf( "MeeGo" ) > -1 && ua.indexOf( "NokiaBrowser/8.5.0" ) > -1 )

0 commit comments

Comments
 (0)