Merge pull request #2927 from spenceralger/restartApp

[navbar] when an app is active, reset the url when clicking the app link
This commit is contained in:
Spencer 2015-02-06 16:56:49 -07:00
commit 3130f3ce1f
2 changed files with 5 additions and 4 deletions

View file

@ -6,8 +6,9 @@ define(function (require) {
return 'lastPath:' + app.id;
}
function getLastPath(app) {
app.lastPath = sessionStorage.get(appKey(app)) || '/' + app.id;
function assignPaths(app) {
app.rootPath = '/' + app.id;
app.lastPath = sessionStorage.get(appKey(app)) || app.rootPath;
return app.lastPath;
}
@ -22,7 +23,7 @@ define(function (require) {
$scope.apps = Private(require('registry/apps'));
// initialize each apps lastPath (fetch it from storage)
$scope.apps.forEach(getLastPath);
$scope.apps.forEach(assignPaths);
$scope.apps.forEach(getShow);

View file

@ -19,7 +19,7 @@
<li class="logo hidden-xs"></li>
<li class="navbar-brand hidden-xs">Kibana</li>
<li ng-repeat="app in apps.inOrder | filter:{show: true}" ng-class="{active: activeApp === app}">
<a ng-href="#{{app.lastPath}}" bo-text="app.name"></a>
<a ng-href="#{{app === activeApp ? app.rootPath : app.lastPath}}" bo-text="app.name"></a>
</li>
</ul>