nunaliit2-js: Fix window resize error on event.