1
0
mirror of https://github.com/DataTables/DataTables.git synced 2024-12-01 13:24:10 +01:00

Updated: Slightly faster code for _fnStringToCss - thanks to sd_zuo, 3036

This commit is contained in:
Allan Jardine 2010-10-18 09:26:37 +01:00
parent 1e9aaee457
commit 1dd9630d53

View File

@ -5477,12 +5477,12 @@
return s+"px";
}
if ( s.indexOf('em') != -1 || s.indexOf('%') != -1 || s.indexOf('ex') != -1 ||
s.indexOf('px') != -1 || s.indexOf('pt') != -1 )
/* Check if the last character is not 0-9 */
var c = s.charCodeAt( s.length-1 );
if (c < 0x30 || c > 0x39)
{
return s;
}
return s+"px";
}