Use the collapse api for hiding the navbar