MCPcopy Index your code
hub / github.com/SpringRoll/SpringRoll / innerSize

Function innerSize

docs/assets/split.js:362–386  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

360 }
361
362 function innerSize(element) {
363 // Return nothing if getComputedStyle is not supported (< IE9)
364 // Or if parent element has no layout yet
365 if (!getComputedStyle) { return null }
366
367 var computedStyle = getComputedStyle(element);
368
369 if (!computedStyle) { return null }
370
371 var size = element[clientSize];
372
373 if (size === 0) { return null }
374
375 if (direction === HORIZONTAL) {
376 size -=
377 parseFloat(computedStyle.paddingLeft) +
378 parseFloat(computedStyle.paddingRight);
379 } else {
380 size -=
381 parseFloat(computedStyle.paddingTop) +
382 parseFloat(computedStyle.paddingBottom);
383 }
384
385 return size
386 }
387
388 // When specifying percentage sizes that are less than the computed
389 // size of the element minus the gutter, the lesser percentages must be increased

Callers 1

trimToMinFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected