@raona/components
Version:
React components used at Raona to work with SPFx
26 lines (25 loc) • 979 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Set the section of webparts to full minHeight
* @param classToSearch - Class to search for
* @param classToModify - Class to modify, it searches by contains, not strict
*/
function setFullminHeight(classToSearch, classToModify) {
var searchElement = document.querySelector(classToSearch);
if (searchElement) {
var elemHeight = searchElement.clientHeight;
var toModify = document.querySelector("[class*=\"" + classToModify + "\"]");
if (toModify) {
// toModify.style.minHeight = `${elemHeight}px`;
toModify.style.minHeight = elemHeight + "px";
}
else {
console.log('Cannot find the div to modify: ', classToModify);
}
}
else {
console.log("Couldn't find the div to search for. Classname: ", classToSearch);
}
}
exports.setFullminHeight = setFullminHeight;
;