From 3073b27abd82ab0b50e87c14c5362b8bafe97044 Mon Sep 17 00:00:00 2001 From: Leo Horie Date: Wed, 10 Dec 2014 23:06:15 -0500 Subject: [PATCH] improve loop --- mithril.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril.js b/mithril.js index db6d7d5c..867d4ed7 100644 --- a/mithril.js +++ b/mithril.js @@ -521,10 +521,10 @@ var m = (function app(window, undefined) { }; m.redraw.strategy = m.prop(); function redraw() { - var mode = m.redraw.strategy(); + var forceRedraw = m.redraw.strategy() === "all"; for (var i = 0, root; root = roots[i]; i++) { if (controllers[i]) { - m.render(root, modules[i].view(controllers[i]), mode === "all") + m.render(root, modules[i].view(controllers[i]), forceRedraw) } } //after rendering within a routed context, we need to scroll back to the top, and fetch the document title for history.pushState