Skip to content

Instantly share code, notes, and snippets.

@AutomatedTester
Forked from isaulv/gist:2dacbeafb78019a44016
Last active August 29, 2015 14:00
Show Gist options
  • Save AutomatedTester/dca633b12008d335eb39 to your computer and use it in GitHub Desktop.
Save AutomatedTester/dca633b12008d335eb39 to your computer and use it in GitHub Desktop.
var callback = arguments[arguments.length - 1];
var any_activity_yet = false;
var checkInactive = function() {
var result = (window.jQuery != null) && (jQuery.active === 0);
if ((result == true) && (any_activity_yet == true)) {
return callback();
}
if (result == false) {
any_activity_yet = true;
}
setTimeout(checkInactive, 250);
}
checkInactive();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment