I want to size my webpart height after ContentRow is resized but how ?
If I add my code to last of the webpart page for javascript like this,
<script>
var h = (document.getElementById("contentRow").clientHeight);
console.log(h); // output is 7
var elems = document.getElementsByClassName('my-webpart');
for (var i = 0; i < elems.length; i++) {
elems[i].style.height = h + 'px';
}
</script>
I don't want to use window.load or jquery document ready as they take too much time to resize my webpart. I want my webpart to me contentRow height size as soon as possible.
EDIT
Where can I find code where SharePoint team is setting height on contentRow on page load or on page resize?
Because contentRow inherits from s4-workspace, lets find out where its height is set and what happens on window resize