From e2b52e1e401af05a6fe3ca7bf9e714f973fc4d61 Mon Sep 17 00:00:00 2001 From: John Resig Date: Sat, 24 Mar 2007 02:44:41 +0000 Subject: [PATCH] Added support for comma-separated .is(), touched up the test cases. Resolves #977. --- src/jquery/coreTest.js | 8 ++++---- src/jquery/jquery.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/jquery/coreTest.js b/src/jquery/coreTest.js index ab47c463..4c6515a8 100644 --- a/src/jquery/coreTest.js +++ b/src/jquery/coreTest.js @@ -576,10 +576,10 @@ test("is(String)", function() { ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' ); // test is() with comma-seperated expressions - ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Check for lang attribute: Expecte en or de' ); - ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Check for lang attribute: Expecte en or de' ); + ok( $('#en').is('[@lang="en"],[@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="en"] , [@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); + ok( $('#en').is('[@lang="de"] , [@lang="en"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' ); }); test("$.extend(Object, Object)", function() { diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index cf9459d2..489522f6 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -1041,7 +1041,7 @@ jQuery.fn = jQuery.prototype = { * @cat DOM/Traversing */ is: function(expr) { - return expr ? jQuery.filter(expr,this).r.length > 0 : false; + return expr ? jQuery.multiFilter(expr,this).length > 0 : false; }, /**