UNPKG

react-dyn-tabs

Version:
12 lines 390 B
/** * * @param {Object} btnEl * @param {Number} margin */ export default function (btnEl, margin) { var _btnEl$getBoundingCli = btnEl.getBoundingClientRect(), top = _btnEl$getBoundingCli.top, bottom = _btnEl$getBoundingCli.bottom; bottom = Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) - bottom; return Math.max(top, bottom) - margin; }