Use .nav-collapse to determine whether nav is collapsed

.visible-desktop is not an accurate way to determine whether the navigation is collapsed.

The device widths at which the .visible-desktop class is shown/hidden are hardcoded into Bootstrap 2's responsive stylesheets. 
If you've customized Bootstrap's variables.less to change the @navbarCollapseWidth, .visible-desktop won't match.