MCPcopy Create free account
hub / github.com/breck7/scroll / _fnStringToCss

Function _fnStringToCss

external/.datatables.js:5126–5137  ·  view source on GitHub ↗

* Append a CSS unit (only if required) to a string * @param {string} value to css-ify * @returns {string} value with css unit * @memberof DataTable#oApi

(s)

Source from the content-addressed store, hash-verified

5124 * @memberof DataTable#oApi
5125 */
5126 function _fnStringToCss(s) {
5127 if (s === null) {
5128 return "0px"
5129 }
5130
5131 if (typeof s == "number") {
5132 return s < 0 ? "0px" : s + "px"
5133 }
5134
5135 // Check it has a unit character already
5136 return s.match(/\d$/) ? s + "px" : s
5137 }
5138
5139 /**
5140 * Re-insert the `col` elements for current visibility

Callers 3

sizeFunction · 0.85
_fnScrollDrawFunction · 0.85
_fnCalculateColumnWidthsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected