Commit a82b048d authored by Jörn Zaefferer's avatar Jörn Zaefferer

Fix for #883

parent 4e256bff
...@@ -102,7 +102,7 @@ test("attr(Hash)", function() { ...@@ -102,7 +102,7 @@ test("attr(Hash)", function() {
}); });
test("attr(String, Object)", function() { test("attr(String, Object)", function() {
expect(6); expect(7);
var div = $("div"); var div = $("div");
div.attr("foo", "bar"); div.attr("foo", "bar");
var pass = true; var pass = true;
...@@ -110,6 +110,8 @@ test("attr(String, Object)", function() { ...@@ -110,6 +110,8 @@ test("attr(String, Object)", function() {
if ( div.get(i).getAttribute('foo') != "bar" ) pass = false; if ( div.get(i).getAttribute('foo') != "bar" ) pass = false;
} }
ok( pass, "Set Attribute" ); ok( pass, "Set Attribute" );
ok( $("#foo").attr({"width": null}), "Try to set an attribute to nothing" );
$("#name").attr('name', 'something'); $("#name").attr('name', 'something');
ok( $("#name").attr('name') == 'something', 'Set name attribute' ); ok( $("#name").attr('name') == 'something', 'Set name attribute' );
......
...@@ -1281,7 +1281,7 @@ jQuery.extend({ ...@@ -1281,7 +1281,7 @@ jQuery.extend({
var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i; var exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;
// Handle passing in a number to a CSS property // 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 + "px";
return value; return value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment