Upgraded to work with latest jQuery versions.

JQuery’s .data(‘event’) method no longer can detect events attached to
DOM elements, instead use jQuery’s private $._data() function to see
all events attached, and then look for properties from there.