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:
ece001f
)
jquery dimensions: removed redundant code
author
Ariel Flesler
<aflesler@gmail.com>
Fri, 6 Mar 2009 04:23:44 +0000
(
04:23
+0000)
committer
Ariel Flesler
<aflesler@gmail.com>
Fri, 6 Mar 2009 04:23:44 +0000
(
04:23
+0000)
src/dimensions.js
patch
|
blob
|
history
diff --git
a/src/dimensions.js
b/src/dimensions.js
index
2ba8f67
..
f438db0
100644
(file)
--- a/
src/dimensions.js
+++ b/
src/dimensions.js
@@
-3,24
+3,22
@@
jQuery.each([ "Height", "Width" ], function(i, name){
var tl = i ? "Left" : "Top", // top or left
br = i ? "Right" : "Bottom", // bottom or right
var tl = i ? "Left" : "Top", // top or left
br = i ? "Right" : "Bottom", // bottom or right
- lower = name.toLowerCase();
+ type = name.toLowerCase();
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function(){
return this[0] ?
// innerHeight and innerWidth
jQuery.fn["inner" + name] = function(){
return this[0] ?
- jQuery.css( this[0], lower, false, "padding" ) :
+ jQuery.css( this[0], type, false, "padding" ) :
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] ?
- jQuery.css( this[0], lower, false, margin ? "margin" : "border" ) :
+ jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
null;
};
null;
};
- var type = name.toLowerCase();
-
jQuery.fn[ type ] = function( size ) {
// Get window width or height
return this[0] == window ?
jQuery.fn[ type ] = function( size ) {
// Get window width or height
return this[0] == window ?