git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6bec619
)
Made sure that css('width') and height returned string values, not numerical values...
author
John Resig
<jeresig@gmail.com>
Thu, 10 Dec 2009 04:51:58 +0000
(20:51 -0800)
committer
John Resig
<jeresig@gmail.com>
Thu, 10 Dec 2009 04:51:58 +0000
(20:51 -0800)
src/css.js
patch
|
blob
|
history
test/unit/css.js
patch
|
blob
|
history
diff --git
a/src/css.js
b/src/css.js
index
c36b6dc
..
7215fe6
100644
(file)
--- a/
src/css.js
+++ b/
src/css.js
@@
-18,8
+18,8
@@
var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
jQuery.fn.css = function( name, value ) {
return access( this, name, value, true, function( elem, name, value ) {
jQuery.fn.css = function( name, value ) {
return access( this, name, value, true, function( elem, name, value ) {
- if (value === undefined) {
- return jQuery.css( elem, name );
+ if ( value === undefined ) {
+ return jQuery.curCSS( elem, name );
}
if ( typeof value === "number" && !rexclude.test(name) ) {
}
if ( typeof value === "number" && !rexclude.test(name) ) {
diff --git
a/test/unit/css.js
b/test/unit/css.js
index
7627475
..
5e88254
100644
(file)
--- a/
test/unit/css.js
+++ b/
test/unit/css.js
@@
-1,7
+1,7
@@
module("css");
test("css(String|Hash)", function() {
module("css");
test("css(String|Hash)", function() {
- expect(27);
+ expect(28);
equals( jQuery('#main').css("display"), 'none', 'Check for css property "display"');
equals( jQuery('#main').css("display"), 'none', 'Check for css property "display"');
@@
-56,6
+56,8
@@
test("css(String|Hash)", function() {
}
equals( prctval, checkval, "Verify fontSize % set." );
}
equals( prctval, checkval, "Verify fontSize % set." );
+
+ equals( typeof child.css("width"), "string", "Make sure that a string width is returned from css('width')." );
});
test("css(String, Object)", function() {
});
test("css(String, Object)", function() {