Provide resizeCanvasElements JS function

Allows pages which have togglable side-bars to resize the canvas
elements when this happens.