ui-router for handled link, $window.location for rest

This e.g. fixes exporting to pdf as the ui router does not handle this link
pull/5445/head
Jens Ulferts 8 years ago
parent cfcd859c3f
commit d86d172dee
No known key found for this signature in database
GPG Key ID: 3CAA4B1182CF5308
  1. 5
      frontend/app/components/routing/wp-show/wp-show.controller.ts
  2. 5
      frontend/app/components/wp-details/wp-details-toolbar.directive.ts

@ -92,7 +92,12 @@ export class WorkPackageShowController extends WorkPackageViewController {
this.deleteSelectedWorkPackage();
break;
default:
var stateForLink = $state.get().filter(state => state.$$state().url.exec(link));
if (stateForLink.length > 0) {
this.$location.path(link);
} else {
this.$window.location.href = link;
}
break;
}
};

@ -103,7 +103,12 @@ function wpDetailsToolbar(
deleteSelectedWorkPackage();
break;
default:
var stateForLink = $state.get().filter(state => state.$$state().url.exec(link));
if (stateForLink.length > 0) {
$location.path(link);
} else {
$window.location.href = link;
}
break;
}
};

Loading…
Cancel
Save