Skip to content

Commit 5a92ec2

Browse files
committed
jquery dimensions & offset: moving the local function 'num' to core, so it can be safely used by both modules.
1 parent 1382ea8 commit 5a92ec2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,3 +1359,8 @@ jQuery.each([ "Height", "Width" ], function(i, name){
13591359
this.css( type, size.constructor == String ? size : size + "px" );
13601360
};
13611361
});
1362+
1363+
// Helper function used by the dimensions and offset modules
1364+
function num(elem, prop) {
1365+
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
1366+
}

src/dimensions.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,4 @@ jQuery.each([ "Height", "Width" ], function(i, name){
2020
num(this, "margin" + tl) + num(this, "margin" + br) : 0);
2121
};
2222

23-
});
24-
25-
function num(elem, prop) {
26-
return elem[0] && parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
27-
}
23+
});

0 commit comments

Comments
 (0)