rochal/jQuery-slimScroll — pull request #122 by joshuaballoch (2014-01-23 04:00:28+00:00)
Title: [Critical Bug] dynamically assign isOverPanel to reduce mistaken mousewheel captures

I found that slimScroll was causing my mousewheel behaviour to break (become completely inoperable) occasionally.

Steps to replicate:

1. initialize a slimScroll element
2. hover over the element
3. destroy slimScroll while still hovering over the element
4. Try to scroll in the browser window

Expect:

1. Scroll works normally

Get:

1. Scroll does not work at all, in any browser.

The cause:

1. if slimScroll gets destroyed while the mouse is hovered over the scroll (e.g. if the slimScroll content has a link, in a pushState site),
2. isOverPanel is still assigned as true at the point of destroying slimScroll
3. then, _onWheel will execute instead of a normal browser scroll..

This pull request suggests changing isOverPanel to a simple function that gets assessed at the time it is needed, to avoid false assignments.