angular-dynamic-layout
angular-dynamic-layout copied to clipboard
Getting dynamic height of the dynamic-layout div
Great directive, but I can't seem to get the height of the container, 'dynamic-layout' which contains all of the cards. I see on your example, there is the same issue.
http://tristanguigue.github.io/angular-dynamic-layout/
I see you've mentioned something about a timeout, but that doesn't seem to work for me. Any ideas?
Hi, I'd love to get an answer to JeanHules's question. I'm having the same issue!
Sorry for the delay, if you take the scrollHeight
of the element it should work
So I'm still having issues with this because I need to make a calculation (using scrollHeight) each time a page is loaded with the dynamic layout container. Is there any way to make the parent div take up the whole space of the isotope items?
I did also not manage to get height based on scrollheight running. Always fails on xs devices. Would be great to have a solution for the height issue.
The problem is due to the absolute positioning of the elements. Unfortunately I don't have an easy solution or the time to look for it for now. If anyone does please let me know or send me a pull request.
I tried this:
function layout() {
angular.element('.auto-height').css('height', (element[0].scrollHeight) );
return PositionService.layout(element[0].offsetWidth);
}
unfortunately it has on chrome the height is around 60px to much. And when it gets to the xs size of the site the height is around 10% to small.
Any idea why this happens?
Unfortunately I don't have an easy solution or the time to look for it for now.
@tristanguigue would you mind sharing your not so easy idea of how to resolve this with us? I don't mind implementing it if I would know how to tackle the problem at all.
@tristanguigue I fixed this issue now this way: https://github.com/netstyler/angular-dynamic-layout/commit/a1c3b78dc680a1d38513cc62b3c95022524dda08
On my application it is working now perfectly with elements after
See also other commits I did in my fork https://github.com/netstyler/angular-dynamic-layout/commits/feature/24
Thanks @netstyler that seems like the only way to go indeed do you mind submitting a Pull Request with those changes?
Your welcome. And thanks also for your work! Pull request done ;)