From 3622a67216ede5481af970c7ae19e5f31b999791 Mon Sep 17 00:00:00 2001 From: Oliver Foster Date: Wed, 2 Aug 2017 11:32:06 +0100 Subject: [PATCH] issue/1582: _canNavigate after router:navigate (#1688) * issue/1582: _canNavigate after router:navigate * issue/1582: removed variable caching * issue/1582: removed whitespace --- src/core/js/router.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/js/router.js b/src/core/js/router.js index 85b219069..5cd0139e7 100644 --- a/src/core/js/router.js +++ b/src/core/js/router.js @@ -47,9 +47,7 @@ define([ handleRoute: function() { var args = this.pruneArguments(arguments); - var canNavigate = Adapt.router.get('_canNavigate'); - - if (canNavigate) { + if (Adapt.router.get('_canNavigate')) { // Reset _isCircularNavigationInProgress protection as code is allowed to navigate away this._isCircularNavigationInProgress = false; } @@ -61,7 +59,8 @@ define([ Adapt.trigger("router:navigate", args); } - if (canNavigate) { + // recheck as _canNavigate can be set to false on router:navigate event + if (Adapt.router.get('_canNavigate')) { //disable navigation whilst rendering Adapt.router.set('_canNavigate', false, {pluginName: "adapt"});