#686 prevent redraw lock on error
This commit is contained in:
parent
04911d38a5
commit
505d7b930d
3 changed files with 18 additions and 14 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,2 +1 @@
|
|||
node_modules
|
||||
archive
|
||||
|
|
|
|||
|
|
@ -33,7 +33,8 @@ module.exports = function(grunt) {
|
|||
"mithril",
|
||||
"mithril.computation",
|
||||
"mithril.deferred",
|
||||
"mithril.module",
|
||||
"mithril.mount",
|
||||
"mithril.component",
|
||||
"mithril.prop",
|
||||
"mithril.redraw",
|
||||
"mithril.render",
|
||||
|
|
|
|||
|
|
@ -615,6 +615,7 @@ var m = (function app(window, undefined) {
|
|||
if (redrawing) return;
|
||||
redrawing = true;
|
||||
if (force) forcing = true;
|
||||
try {
|
||||
//lastRedrawId is a positive number if a second redraw is requested before the next animation frame
|
||||
//lastRedrawID is null if it's the first redraw and not an event handler
|
||||
if (lastRedrawId && force !== true) {
|
||||
|
|
@ -629,7 +630,10 @@ var m = (function app(window, undefined) {
|
|||
redraw();
|
||||
lastRedrawId = $requestAnimationFrame(function() { lastRedrawId = null; }, FRAME_BUDGET);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
redrawing = forcing = false;
|
||||
}
|
||||
};
|
||||
m.redraw.strategy = m.prop();
|
||||
function redraw() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue