only add scroll event if the sidebar exists

I originally added this functionality, but only just now noticed that it gives errors on comment pages where the sidebar doesn't exist. This is mostly only an issue with developers who have pausing on exceptions enabled, but figured it was worth the fix anyways.