Fix the header links when we're on a non-angular page.

This commit is contained in:
yackob03 2013-10-24 23:56:08 -04:00
parent a8ebdc79c4
commit e418d21d31
2 changed files with 12 additions and 5 deletions

View file

@ -62,7 +62,14 @@ function HeaderCtrl($scope, $location, UserService, Restangular) {
UserService.load();
$location.path('/');
});
}
};
$scope.appLinkTarget = function() {
if ($("div[ng-view]").length === 0) {
return "_self";
}
return "";
};
$scope.$on('$includeContentLoaded', function() {
// THIS IS BAD, MOVE THIS TO A DIRECTIVE

View file

@ -14,9 +14,9 @@
<!-- Collapsable stuff -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li><a ng-href="/repository/">Repositories</a></li>
<li><a ng-href="/guide/">User Guide</a></li>
<li><a ng-href="/plans/">Plans &amp; Pricing</a></li>
<li><a ng-href="/repository/" target="{{ appLinkTarget() }}">Repositories</a></li>
<li><a ng-href="/guide/" target="{{ appLinkTarget() }}">User Guide</a></li>
<li><a ng-href="/plans/" target="{{ appLinkTarget() }}">Plans &amp; Pricing</a></li>
</ul>
@ -38,7 +38,7 @@
</a>
<ul class="dropdown-menu">
<li>
<a href="/user/">
<a href="/user/" target="{{ appLinkTarget() }}">
Account Settings
<span class="badge user-notification" ng-show="user.askForPassword">1</span>
</a>