Side navigation
Ticket #2104: find-with-object-support.diff
File find-with-object-support.diff, 0.5 KB (added by torben, January 02, 2008 04:07PM UTC)
patch enabling fallback to standard jQ query if an object different from string is passed
Index: D:/Data/SKL-workspace/jquery/src/core.js
===================================================================
--- D:/Data/SKL-workspace/jquery/src/core.js (revision 4340)
+++ D:/Data/SKL-workspace/jquery/src/core.js (working copy)
@@ -281,6 +281,10 @@
},
find: function( selector ) {
+ // Quickly handle non-string expressions
+ if ( typeof selector != "string" )
+ return jQuery(selector);
+
var elems = jQuery.map(this, function(elem){
return jQuery.find( selector, elem );
});
Download in other formats:
Original Format
File find-with-object-support.diff, 0.5 KB (added by torben, January 02, 2008 04:07PM UTC)
patch enabling fallback to standard jQ query if an object different from string is passed
Index: D:/Data/SKL-workspace/jquery/src/core.js
===================================================================
--- D:/Data/SKL-workspace/jquery/src/core.js (revision 4340)
+++ D:/Data/SKL-workspace/jquery/src/core.js (working copy)
@@ -281,6 +281,10 @@
},
find: function( selector ) {
+ // Quickly handle non-string expressions
+ if ( typeof selector != "string" )
+ return jQuery(selector);
+
var elems = jQuery.map(this, function(elem){
return jQuery.find( selector, elem );
});