fix(uiLayout): remove event listeners from destroyed elements

Removes the event listener for the window resize event when the element's scope is destroyed.