Fix for #883
This commit is contained in:
parent
4e256bffa3
commit
a82b048db8
2 changed files with 4 additions and 2 deletions
4
src/jquery/coreTest.js
vendored
4
src/jquery/coreTest.js
vendored
|
@ -102,7 +102,7 @@ test("attr(Hash)", function() {
|
|||
});
|
||||
|
||||
test("attr(String, Object)", function() {
|
||||
expect(6);
|
||||
expect(7);
|
||||
var div = $("div");
|
||||
div.attr("foo", "bar");
|
||||
var pass = true;
|
||||
|
@ -111,6 +111,8 @@ test("attr(String, Object)", function() {
|
|||
}
|
||||
ok( pass, "Set Attribute" );
|
||||
|
||||
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
|
||||
|
||||
$("#name").attr('name', 'something');
|
||||
ok( $("#name").attr('name') == 'something', 'Set name attribute' );
|
||||
$("#check2").attr('checked', true);
|
||||
|
|
2
src/jquery/jquery.js
vendored
2
src/jquery/jquery.js
vendored
|
@ -1281,7 +1281,7 @@ jQuery.extend({
|
|||
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
|
||||
|
||||
// Handle passing in a number to a CSS property
|
||||
if ( value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
|
||||
if ( value && value.constructor == Number && type == "curCSS" && !exclude.test(prop) )
|
||||
return value + "px";
|
||||
|
||||
return value;
|
||||
|
|
Loading…
Reference in a new issue