Paranoid requestAnimationFrame for antique Firefox

Very old versions of Firefox - e.g. Firefox 7 - have
window.requestAnimationFrame but not cancelAnimationFrame. This is a
very old release so the easiest fix is simply to check for both of the
functions which we intend to call and fall back on traditional behaviour
if both aren't present.
This commit is contained in:
Chris Adams 2013-05-23 10:10:32 -04:00
parent 673f881d52
commit 568d6a1c6b

View File

@ -1662,7 +1662,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){
// polyfill, when necessary // polyfill, when necessary
if ( w.requestAnimationFrame ) { if ( w.requestAnimationFrame && w.cancelAnimationFrame ) {
//we cant assign window.requestAnimationFrame directly to $.requestAnimationFrame //we cant assign window.requestAnimationFrame directly to $.requestAnimationFrame
//without getting Illegal Invocation errors in webkit so call in a //without getting Illegal Invocation errors in webkit so call in a
//wrapper //wrapper