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:
51d2580
)
Cleaning up some un-needed CSS code and adding back a temporary (deprecated) curCSS...
author
John Resig
<jeresig@gmail.com>
Fri, 17 Sep 2010 18:41:28 +0000
(14:41 -0400)
committer
John Resig
<jeresig@gmail.com>
Fri, 17 Sep 2010 18:41:28 +0000
(14:41 -0400)
src/css.js
patch
|
blob
|
history
src/dimensions.js
patch
|
blob
|
history
diff --git
a/src/css.js
b/src/css.js
index
9113be2
..
8ea815c
100644
(file)
--- a/
src/css.js
+++ b/
src/css.js
@@
-21,7
+21,9
@@
var ralpha = /alpha\([^)]*\)/,
jQuery.fn.css = function( name, value ) {
return jQuery.access( this, name, value, true, function( elem, name, value ) {
jQuery.fn.css = function( name, value ) {
return jQuery.access( this, name, value, true, function( elem, name, value ) {
- return jQuery.css( elem, name, value );
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
});
};
});
};
@@
-90,19
+92,15
@@
jQuery.extend({
}
},
}
},
- css: function( elem, name, value, extra ) {
+ css: function( elem, name, extra ) {
// Make sure that we're working with the right name
var ret, origName = name.replace( rdashAlpha, fcamelCase ),
hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
// Make sure that we're working with the right name
var ret, origName = name.replace( rdashAlpha, fcamelCase ),
hooks = jQuery.cssHooks[ origName ];
name = jQuery.cssProps[ origName ] || origName;
- // Check if we're setting a value, just use jQuery.style (DEPRECATED)
- if ( value !== undefined ) {
- jQuery.style( elem, name, value );
-
// If a hook was provided get the computed value from there
// If a hook was provided get the computed value from there
- } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
return ret;
// Otherwise, if a way to get the computed value exists, use that
return ret;
// Otherwise, if a way to get the computed value exists, use that
@@
-130,6
+128,9
@@
jQuery.extend({
}
});
}
});
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
jQuery.each(["height", "width"], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
jQuery.each(["height", "width"], function( i, name ) {
jQuery.cssHooks[ name ] = {
get: function( elem, computed, extra ) {
diff --git
a/src/dimensions.js
b/src/dimensions.js
index
698f5f4
..
26c40c3
100644
(file)
--- a/
src/dimensions.js
+++ b/
src/dimensions.js
@@
-8,14
+8,14
@@
jQuery.each([ "Height", "Width" ], function( i, name ) {
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function() {
return this[0] ?
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function() {
return this[0] ?
- parseFloat( jQuery.css( this[0], type, undefined, "padding" ), 10 ) :
+ parseFloat( jQuery.css( this[0], type, "padding" ), 10 ) :
null;
};
// outerHeight and outerWidth
jQuery.fn["outer" + name] = function( margin ) {
return this[0] ?
null;
};
// outerHeight and outerWidth
jQuery.fn["outer" + name] = function( margin ) {
return this[0] ?
- parseFloat( jQuery.css( this[0], type, undefined, margin ? "margin" : "border" ), 10 ) :
+ parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ), 10 ) :
null;
};
null;
};