Fixed window resize event conditions.