Added support for comma-separated .is(), touched up the test cases. Resolves #977.
This commit is contained in:
parent
6d03f9290e
commit
e2b52e1e40
8
src/jquery/coreTest.js
vendored
8
src/jquery/coreTest.js
vendored
|
@ -576,10 +576,10 @@ test("is(String)", function() {
|
||||||
ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );
|
ok( !$('#foo').is(undefined), 'Expected false for an invalid expression - undefined' );
|
||||||
|
|
||||||
// test is() with comma-seperated expressions
|
// 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="en"],[@lang="de"]'), 'Comma-seperated; Check for lang attribute: Expect en or de' );
|
||||||
ok( $('#en').is('[@lang="de"],[@lang="en"]'), 'Check for lang attribute: Expecte 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"]'), '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"]'), 'Check for lang attribute: Expecte 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() {
|
test("$.extend(Object, Object)", function() {
|
||||||
|
|
2
src/jquery/jquery.js
vendored
2
src/jquery/jquery.js
vendored
|
@ -1041,7 +1041,7 @@ jQuery.fn = jQuery.prototype = {
|
||||||
* @cat DOM/Traversing
|
* @cat DOM/Traversing
|
||||||
*/
|
*/
|
||||||
is: function(expr) {
|
is: function(expr) {
|
||||||
return expr ? jQuery.filter(expr,this).r.length > 0 : false;
|
return expr ? jQuery.multiFilter(expr,this).length > 0 : false;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue