[M] Add window.resize listener and fixes