d3 view open/closes when navigating to other tabs