Skip to content

Commit

Permalink
pushing out fix for requestFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
csuwildcat committed May 11, 2014
1 parent 7174994 commit 2405934
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -646,13 +646,19 @@
});
},

requestFrame: win.requestAnimationFrame ||
win[prefix.lowercase + 'RequestAnimationFrame'] ||
function(fn){ return win.setTimeout(fn, 20); },

cancelFrame: win.cancelAnimationFrame ||
win[prefix.lowercase + 'CancelAnimationFrame'] ||
win.clearTimeout,
requestFrame: (function(){
var raf = win.requestAnimationFrame ||
win[prefix.lowercase + 'RequestAnimationFrame'] ||
function(fn){ return win.setTimeout(fn, 20); };
return function(fn){ return raf(fn); };
})(),

cancelFrame: (function(){
var cancel = win.cancelAnimationFrame ||
win[prefix.lowercase + 'CancelAnimationFrame'] ||
win.clearTimeout;
return function(id){ return cancel(id); };
})(),

matchSelector: function (element, selector) {
return matchSelector.call(element, selector);
Expand Down

0 comments on commit 2405934

Please sign in to comment.