Refactor the run configuration

pull/4029/head
Alex Dik 9 years ago
parent 65c46896a8
commit 000658fea5
  1. 12
      frontend/app/components/common/routing.ts

@ -239,10 +239,9 @@ angular
// Angular's HTML5-mode turns on. // Angular's HTML5-mode turns on.
$rootElement.off('click'); $rootElement.off('click');
$rootElement.on('click', 'a[data-ui-route]', (event) => { $rootElement.on('click', 'a[data-ui-route]', (event) => {
if (!jQuery('body').has('div[ui-view]').length) { if (!jQuery('body').has('div[ui-view]').length || event.ctrlKey || event.metaKey
return; || event.which === 2) {
}
if (event.ctrlKey || event.metaKey || event.which === 2) {
return; return;
} }
@ -251,10 +250,9 @@ angular
var absHref = elm.prop('href'); var absHref = elm.prop('href');
var rewrittenUrl = $location.$$rewrite(absHref); var rewrittenUrl = $location.$$rewrite(absHref);
if (absHref && !elm.attr('target') && if (absHref && !elm.attr('target') && rewrittenUrl && !event.isDefaultPrevented()) {
rewrittenUrl && !event.isDefaultPrevented()) {
event.preventDefault(); event.preventDefault();
if (rewrittenUrl !== $browser.url()) { if (rewrittenUrl !== $browser.url()) {
// update location manually // update location manually
$location.$$parse(rewrittenUrl); $location.$$parse(rewrittenUrl);

Loading…
Cancel
Save