Added logic to hide/show the navbar based on device/orientation.