From 37c3278ded3a63fbf7085beba043da1780203995 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Tue, 7 Jul 2015 00:30:35 +0200 Subject: [PATCH] router: another bugfix --- lib/router.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/router.js b/lib/router.js index 5956b27..51b9e0e 100644 --- a/lib/router.js +++ b/lib/router.js @@ -122,18 +122,21 @@ define(function () { if (!currentView || running) currentView = d - if (running) { - if (currentObject) { - if ("node" in currentObject) - gotoNode(currentObject.node) - else if ("link" in currentObject) - gotoLink(currentObject.link) + if (!running) + return - saveState() - } else - console.log("reset view") - resetView() + saveState() + + if (!currentObject) { + resetView(false) + return } + + if ("node" in currentObject) + gotoNode(currentObject.node) + + if ("link" in currentObject) + gotoLink(currentObject.link) } }