From: Ariel Flesler Date: Thu, 15 May 2008 12:53:07 +0000 (+0000) Subject: jquery dimensions & offset: moving the local function 'num' to core, so it can be... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=5a92ec263d8289d2b6d21bcbfe02910c47a6ea4a jquery dimensions & offset: moving the local function 'num' to core, so it can be safely used by both modules. --- diff --git a/src/core.js b/src/core.js index e988d48..fedd292 100644 --- a/src/core.js +++ b/src/core.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; +} \ No newline at end of file diff --git a/src/dimensions.js b/src/dimensions.js index 44ba357..bcef47f 100644 --- a/src/dimensions.js +++ b/src/dimensions.js @@ -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; -} +}); \ No newline at end of file