The check you've put basically amounts to: if we are on a page that contains a `div.viewMain`, don't scroll the sidebar when the window scrolls. All of the pages where we actually *want* this behavior to happen do in fact contain `div.viewMain`, namely the tree browser page which can get really long. It sounds like what you want is actually the opposite check:

    if (viewMain.length === 0) {
        return;
    }

No?