Added helper function for dealing with window resizes, so the menu isn't hidden/showing when it should be doing the opposite.