collapsible navbox logic