UNPKG

@raona/components

Version:

React components used at Raona to work with SPFx

36 lines (35 loc) 1.32 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Set the section of webparts to full minHeight * @param expToSearch - Class to search for * @param expToModify - Class to modify, it searches by contains, not strict */ function setMinHeight(expToSearch, expToModify) { try { var searchElement = document.querySelector(expToSearch); if (searchElement) { try { var elemHeight = searchElement.clientHeight; var toModify = document.querySelector(expToModify); if (toModify) { // toModify.style.minHeight = `${elemHeight}px`; toModify.style.minHeight = elemHeight + "px"; } else { console.log("Couldn't find the div to search for. Classname: ", expToModify); } } catch (e) { console.log('Non valid expression: ', expToModify, '|| Error: ', e); } } else { console.log("Couldn't find the div to search for. Classname: ", expToSearch); } } catch (e) { console.log('Non valid expression: ', expToSearch, '|| Error: ', e); } } exports.setMinHeight = setMinHeight;