Commit 5a92ec26 authored by Ariel Flesler's avatar Ariel Flesler

jquery dimensions & offset: moving the local function 'num' to core, so it can...

jquery dimensions & offset: moving the local function 'num' to core, so it can be safely used by both modules.
parent 1382ea8d
...@@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){ ...@@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){
this.css( type, size.constructor == String ? size : size + "px" ); 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
...@@ -20,8 +20,4 @@ jQuery.each([ "Height", "Width" ], function(i, name){ ...@@ -20,8 +20,4 @@ jQuery.each([ "Height", "Width" ], function(i, name){
num(this, "margin" + tl) + num(this, "margin" + br) : 0); num(this, "margin" + tl) + num(this, "margin" + br) : 0);
}; };
}); });
\ No newline at end of file
function num(elem, prop) {
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment