get-outer-width.js 672 B

12345678910111213
  1. import getStyle from './get-style';
  2. import getWidth from './get-width';
  3. export default function getOuterWidth(el, defaultValue) {
  4. var width = getWidth(el, defaultValue);
  5. var bLeft = parseFloat(getStyle(el, 'borderLeftWidth')) || 0;
  6. var pLeft = parseFloat(getStyle(el, 'paddingLeft')) || 0;
  7. var pRight = parseFloat(getStyle(el, 'paddingRight')) || 0;
  8. var bRight = parseFloat(getStyle(el, 'borderRightWidth')) || 0;
  9. var mRight = parseFloat(getStyle(el, 'marginRight')) || 0;
  10. var mLeft = parseFloat(getStyle(el, 'marginLeft')) || 0;
  11. return width + bLeft + bRight + pLeft + pRight + mLeft + mRight;
  12. }
  13. //# sourceMappingURL=get-outer-width.js.map