Collapse navbar only if it is expanded