From 000658fea52f3a115c617f5c65ef2049cc722530 Mon Sep 17 00:00:00 2001 From: Alex Dik Date: Thu, 17 Dec 2015 13:48:14 +0100 Subject: [PATCH] Refactor the run configuration --- frontend/app/components/common/routing.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/app/components/common/routing.ts b/frontend/app/components/common/routing.ts index 2232e4334d..1ff0d89d27 100644 --- a/frontend/app/components/common/routing.ts +++ b/frontend/app/components/common/routing.ts @@ -239,10 +239,9 @@ angular // Angular's HTML5-mode turns on. $rootElement.off('click'); $rootElement.on('click', 'a[data-ui-route]', (event) => { - if (!jQuery('body').has('div[ui-view]').length) { - return; - } - if (event.ctrlKey || event.metaKey || event.which === 2) { + if (!jQuery('body').has('div[ui-view]').length || event.ctrlKey || event.metaKey + || event.which === 2) { + return; } @@ -251,10 +250,9 @@ angular var absHref = elm.prop('href'); var rewrittenUrl = $location.$$rewrite(absHref); - if (absHref && !elm.attr('target') && - rewrittenUrl && !event.isDefaultPrevented()) { - + if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) { event.preventDefault(); + if (rewrittenUrl !== $browser.url()) { // update location manually $location.$$parse(rewrittenUrl);