Skip to content
Permalink
Browse files

jquery dimensions & offset: moving the local function 'num' to core, …

…so it can be safely used by both modules.
  • Loading branch information
flesler committed May 15, 2008
1 parent 1382ea8 commit 5a92ec263d8289d2b6d21bcbfe02910c47a6ea4a
Showing with 6 additions and 5 deletions.
  1. +5 −0 src/core.js
  2. +1 −5 src/dimensions.js
@@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){
this.css( type, size.constructor == String ? size : size + "px" );
};
});

// Helper function used by the dimensions and offset modules
function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
@@ -20,8 +20,4 @@ jQuery.each([ "Height", "Width" ], function(i, name){
num(this, "margin" + tl) + num(this, "margin" + br) : 0);
};

});

function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
});

0 comments on commit 5a92ec2

Please sign in to comment.
You can’t perform that action at this time.