fixed calculation of when to hide the menu for iOS 8