on master help sign in
Merge remote-tracking branch 'evan/dev' into topic/webgl
commit82a41ea17fc2d973b4b528de0e792b97ba56217c authorJohn P Mayer Jr <john.p.mayer.jr@gmail.com> dateTue 7 Jan 2014, 21:04 (13 years ago) parent712f824ae34371
1 file changed+8−8
runtime/Utils.js+8−8
runtime/Utils.js+8−8
@@ -34,18 +34,18 @@ ElmRuntime.filterDeadInputs = function(inputs) {
3434
3535// define the draw function
3636var vendors = ['ms', 'moz', 'webkit', 'o'];
37−var window = window || {};
38−for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
39− window.requestAnimationFrame = window[vendors[i]+'RequestAnimationFrame'];
40− window.cancelAnimationFrame = window[vendors[i]+'CancelAnimationFrame'] ||
41− window[vendors[i]+'CancelRequestAnimationFrame'];
37+var win = window || {};
38+for (var i = 0; i < vendors.length && !win.requestAnimationFrame; ++i) {
39+ win.requestAnimationFrame = win[vendors[i]+'RequestAnimationFrame'];
40+ win.cancelAnimationFrame = win[vendors[i]+'CancelAnimationFrame'] ||
41+ win[vendors[i]+'CancelRequestAnimationFrame'];
4242}
4343
44−if (window.requestAnimationFrame && window.cancelAnimationFrame) {
44+if (win.requestAnimationFrame && win.cancelAnimationFrame) {
4545 var previous = 0;
4646 ElmRuntime.draw = function(callback) {
47− window.cancelAnimationFrame(previous);
48− previous = window.requestAnimationFrame(callback);
47+ win.cancelAnimationFrame(previous);
48+ previous = win.requestAnimationFrame(callback);
4949 };
5050} else {
5151 ElmRuntime.draw = function(callback) { callback(); };