Use vendor detection for requestAnimationFrame
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* full text of the license.
|
||||
*
|
||||
* @requires OpenLayers/SingleFile.js
|
||||
* @requires OpenLayers/Vendor.js
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -19,11 +20,8 @@ OpenLayers.Animation = (function(window) {
|
||||
* Property: isNative
|
||||
* {Boolean} true if a native requestAnimationFrame function is available
|
||||
*/
|
||||
var isNative = !!(window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame);
|
||||
var requestAnimationFrame = OpenLayers.Vendor.jsPrefix(window, "requestAnimationFrame");
|
||||
var isNative = !!(requestAnimationFrame);
|
||||
|
||||
/**
|
||||
* Function: requestFrame
|
||||
@@ -36,11 +34,7 @@ OpenLayers.Animation = (function(window) {
|
||||
* element - {DOMElement} Optional element that visually bounds the animation.
|
||||
*/
|
||||
var requestFrame = (function() {
|
||||
var request = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
window.msRequestAnimationFrame ||
|
||||
var request = window[requestAnimationFrame] ||
|
||||
function(callback, element) {
|
||||
window.setTimeout(callback, 16);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user