Added resize handler to be called when container dimensions change.