Closed aendra-rininsland closed 7 years ago
Actually, disregard for now — I need to amend to provide more detail.
I've updated this to add two helper functions, getGridBreakpoints()
and addBreakpointListeners()
. The former outputs the names and sizes of all grid breakpoints in JSON via html:before
, the later adds MediaQueryListListeners for all o-grid breakpoints that fires an o-grid.layoutChange
CustomEvent when the layout changes.
@JakeChampion I've updated main.js as discussed, apologies for how long that took! I've also changed the API a bit as per discussion with my colleagues.
My colleague and I are working on a project for the homepage front page that needs to respond to changing
o-grid
breakpoints, and we could either use getCurrentLayout() in a listening onwindow.onresize
, which will callgetGridProperties()
continuously, or we could callgetGridProperties()
once during initialisation and then usewindow.matchMedia
based on those values.To that latter end, this PR.