1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-19 12:52:11 +01:00

Update media/src/core/core.sizing.js

Use document.body rather than document.getElementsByTagName
(Makes things consistent with the rest of the codebase and should be faster)

http://jsperf.com/document-body-vs-document-getelementsbytagname-body-0
This commit is contained in:
Tim Tucker 2012-09-03 13:34:10 -03:00
parent 59dc2aed9c
commit ef1c0890df

View File

@ -1,4 +1,3 @@
/**
* Convert a CSS unit width to pixels (e.g. 2em)
* @param {string} sWidth width to be converted
@ -15,7 +14,7 @@ function _fnConvertToWidth ( sWidth, nParent )
if ( !nParent )
{
nParent = document.getElementsByTagName('body')[0];
nParent = document.body;
}
var iWidth;