mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
fix requestAnimationFrame so listen() works
This commit is contained in:
parent
e129e08b9d
commit
55e97171cc
@ -1211,7 +1211,7 @@ function setPresetSelectIndex(gui) {
|
|||||||
|
|
||||||
function updateDisplays(controllerArray) {
|
function updateDisplays(controllerArray) {
|
||||||
if (controllerArray.length !== 0) {
|
if (controllerArray.length !== 0) {
|
||||||
requestAnimationFrame(function() {
|
requestAnimationFrame.call(window, function() {
|
||||||
updateDisplays(controllerArray);
|
updateDisplays(controllerArray);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -11,16 +11,13 @@
|
|||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export default function() {
|
function requestAnimationFrame(callback) {
|
||||||
function requestAnimationFrame(callback) {
|
setTimeout(callback, 1000 / 60);
|
||||||
// TODO: Get rid of window
|
}
|
||||||
window.setTimeout(callback, 1000 / 60);
|
|
||||||
}
|
|
||||||
|
|
||||||
return window.requestAnimationFrame ||
|
export default window.requestAnimationFrame ||
|
||||||
window.webkitRequestAnimationFrame ||
|
window.webkitRequestAnimationFrame ||
|
||||||
window.mozRequestAnimationFrame ||
|
window.mozRequestAnimationFrame ||
|
||||||
window.oRequestAnimationFrame ||
|
window.oRequestAnimationFrame ||
|
||||||
window.msRequestAnimationFrame ||
|
window.msRequestAnimationFrame ||
|
||||||
requestAnimationFrame;
|
requestAnimationFrame;
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user