added optional param to m.redraw() to allow forced update
This commit is contained in:
parent
d567de08a8
commit
774be35cc2
3 changed files with 42 additions and 4 deletions
|
|
@ -406,10 +406,10 @@ Mithril = m = new function app(window, undefined) {
|
|||
m.endComputation()
|
||||
}
|
||||
}
|
||||
m.redraw = function() {
|
||||
m.redraw = function(force) {
|
||||
var cancel = window.cancelAnimationFrame || window.clearTimeout
|
||||
var defer = window.requestAnimationFrame || window.setTimeout
|
||||
if (lastRedrawId) {
|
||||
if (lastRedrawId && !force) {
|
||||
cancel(lastRedrawId)
|
||||
lastRedrawId = defer(redraw, 0)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue