Fix the ongoing transition detector. This should be added to the DOM API already :(
jshint