Fixed check for general browser compatibility.
authorRob Moen <rmoen@wikimedia.org>
Tue, 22 Jan 2013 20:08:19 +0000 (12:08 -0800)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 22 Jan 2013 20:59:19 +0000 (20:59 +0000)
The test below will effectively return false for all versions of IE:
$client.test( {
ltr: {
msie: false
},
rtl: {
msie: false
}
});

Change-Id: I1bff63c0f792222741d63cfb8f03b1e0729410a7

resources/jquery/jquery.client.js

index ae6f2b0..cddd4ec 100644 (file)
 
                        var conditions, dir, i, op, val;
                        profile = $.isPlainObject( profile ) ? profile : $.client.profile();
-
                        dir = $( 'body' ).is( '.rtl' ) ? 'rtl' : 'ltr';
                        // Check over each browser condition to determine if we are running in a compatible client
                        if ( typeof map[dir] !== 'object' || map[dir][profile.name] === undefined ) {
                                return true;
                        }
                        conditions = map[dir][profile.name];
+                       if ( conditions === false ) {
+                               return false;
+                       }
                        for ( i = 0; i < conditions.length; i++ ) {
                                op = conditions[i][0];
                                val = conditions[i][1];
-                               if ( val === false ) {
-                                       return false;
-                               }
                                if ( typeof val === 'string' ) {
                                        if ( !( eval( 'profile.version' + op + '"' + val + '"' ) ) ) {
                                                return false;
                                        }
                                }
                        }
+
                        return true;
                }
        };