Avoid illegal invocation of native method.
This commit is contained in:
@@ -1699,6 +1699,8 @@ OpenLayers.Util.getFormattedLonLat = function(coordinate, axis, dmsOption) {
|
||||
|
||||
OpenLayers.Util.requestAnimationFrame = (function() {
|
||||
return window.requestAnimationFrame ||
|
||||
OpenLayers.Util.requestAnimationFrame = (function(window) {
|
||||
var request = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
window.oRequestAnimationFrame ||
|
||||
@@ -1706,7 +1708,11 @@ OpenLayers.Util.requestAnimationFrame = (function() {
|
||||
function(callback, element) {
|
||||
window.setTimeout(callback, 16);
|
||||
};
|
||||
})();
|
||||
// bind to window to avoid illegal invocation of native function
|
||||
return function(callback, element) {
|
||||
request.apply(window, [callback, element]);
|
||||
};
|
||||
})(window);
|
||||
|
||||
(function() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user