mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-22 23:16:53 +00:00
Fix scrollable widget not to crash on the server
This commit is contained in:
parent
945ad6792f
commit
79d643775d
@ -20,20 +20,22 @@ var ScrollableWidget = function(parseTreeNode,options) {
|
||||
this.addEventListeners([
|
||||
{type: "tw-scroll", handler: "handleScrollEvent"}
|
||||
]);
|
||||
this.requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
return window.setTimeout(callback, 1000/60);
|
||||
};
|
||||
this.cancelAnimationFrame = window.cancelAnimationFrame ||
|
||||
window.webkitCancelAnimationFrame ||
|
||||
window.webkitCancelRequestAnimationFrame ||
|
||||
window.mozCancelAnimationFrame ||
|
||||
window.mozCancelRequestAnimationFrame ||
|
||||
function(id) {
|
||||
window.clearTimeout(id);
|
||||
};
|
||||
if($tw.browser) {
|
||||
this.requestAnimationFrame = window.requestAnimationFrame ||
|
||||
window.webkitRequestAnimationFrame ||
|
||||
window.mozRequestAnimationFrame ||
|
||||
function(callback) {
|
||||
return window.setTimeout(callback, 1000/60);
|
||||
};
|
||||
this.cancelAnimationFrame = window.cancelAnimationFrame ||
|
||||
window.webkitCancelAnimationFrame ||
|
||||
window.webkitCancelRequestAnimationFrame ||
|
||||
window.mozCancelAnimationFrame ||
|
||||
window.mozCancelRequestAnimationFrame ||
|
||||
function(id) {
|
||||
window.clearTimeout(id);
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user