react-dyn-tabs
Version:
React dynamic tabs with full API
16 lines (15 loc) • 456 B
JavaScript
exports.__esModule = true;
exports["default"] = _default;
/**
*
* @param {Object} btnEl
* @param {Number} margin
*/
function _default(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;
}
;