redraw layouts when a page is opened or closed