only add scroll event if the sidebar exists
Merge pull request #1048 from bronzle/scroll_sidebar_only_when_on_page

only add scroll event if the sidebar exists