Chapter 4 handleResize of the chat window.