Hi, all,
I'm building a responsive treesaver publication that needs to adaptively change column width based on screen size and orientation.
For instance, having 2 columns on a portrait iPad, and 3 columns on a landscape iPad, so that they fit within pre-specified margins and gutters.
Basically, I am implementing percentage column widths, as mentioned in issue #275. (
https://github.com/Treesaver/treesaver/issues/275)
I currently tried to solve this through CSS by making a set of @media queries that set the column widths given the device size. However, treesaver remembers the column widths on boot, and even though the media queries change them in the CSS, when I flip from portrait to landscape, the layout is rendered with the old column widths in mind, which are too wide for the new grid.
I tried forcing the reload of the grids in the treesaver ArticleManager by refreshing the resources.html, but it didn't really work. Is there any way that I can trigger a total re-boot of treesaver on re-orientation? Or at least an official way to re-load the grids data structures so they get re-measured? Triggering a page reload on re-orientation is possible, but I'd try to avoid that.
Any ideas on that? What's the usual way of tackling mobile?
thanks,
-- Tadej