aboutsummaryrefslogtreecommitdiffstats
path: root/src/traversing.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2011-04-11 16:00:34 -0400
committerjeresig <jeresig@gmail.com>2011-04-11 16:00:34 -0400
commite9905b15d4ab90471d12508938e8935f4cc63581 (patch)
tree5c2246212f78bed97c4661c713069bfd29b011fb /src/traversing.js
parent094c48e0c5cff8f7cc039426a34ed47b2a748c3c (diff)
parenta564a0b1ec167b2f0fdd2d017a986b226a9850f6 (diff)
downloadjquery-e9905b15d4ab90471d12508938e8935f4cc63581.tar.gz
jquery-e9905b15d4ab90471d12508938e8935f4cc63581.zip
Merge branch '2773_firefox_opera_fix' of https://github.com/timmywil/jquery into timmywil-2773_firefox_opera_fix
Diffstat (limited to 'src/traversing.js')
-rw-r--r--src/traversing.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/traversing.js b/src/traversing.js
index fb5946bba..e0f40151d 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -73,9 +73,9 @@ jQuery.fn.extend({
},
is: function( selector ) {
- return !!selector && (typeof selector === "string" ?
+ return !!selector && ( typeof selector === "string" ?
jQuery.filter( selector, this ).length > 0 :
- this.filter( selector ).length > 0);
+ this.filter( selector ).length > 0 );
},
closest: function( selectors, context ) {
@@ -298,13 +298,18 @@ jQuery.extend({
// Implement the identical functionality for filter and not
function winnow( elements, qualifier, keep ) {
+
+ // Can't pass null or undefined to indexOf in Firefox 4
+ // Set to 0 to skip string check
+ qualifier = qualifier || 0;
+
if ( jQuery.isFunction( qualifier ) ) {
return jQuery.grep(elements, function( elem, i ) {
var retVal = !!qualifier.call( elem, i, elem );
return retVal === keep;
});
- } else if ( qualifier && qualifier.nodeType ) {
+ } else if ( qualifier.nodeType ) {
return jQuery.grep(elements, function( elem, i ) {
return (elem === qualifier) === keep;
});