Skip to content

Commit

Permalink
#853: Allow to configure plugins ordering/enable in nav bar. Work in …
Browse files Browse the repository at this point in the history
…progress.
  • Loading branch information
davsclaus committed Dec 18, 2013
1 parent 950421e commit f829782
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions hawtio-web/src/main/webapp/app/core/js/preferences.ts
Expand Up @@ -346,15 +346,25 @@ module Core {
var plugins = configuredPluginsForPerspective(perspective, workspace, jolokia, localStorage);
$scope.plugins = plugins;
$scope.perspectiveId = perspective.id;

log.info("Updated to perspective " + $scope.perspectiveId + " with " + plugins.length + " plugins");
}

// initialize the controller, and pick the 1st perspective
$scope.perspectives = Perspective.getPerspectives($location, workspace, jolokia, localStorage);
log.info("There are " + $scope.perspectives.length + " perspectives");

updateToPerspective($scope.perspectives[0]);
// pick the current selected perspective
var selectPerspective;
var perspectiveId = Perspective.currentPerspectiveId($location, workspace, jolokia, localStorage);
if (perspectiveId) {
selectPerspective = $scope.perspectives.find(p => p.id === perspectiveId);
}
if (!selectPerspective) {
// just pick the 1st then
selectPerspective = $scope.perspectives[0];
}

updateToPerspective(selectPerspective);
// and force update the ui
Core.$apply($scope);
}
Expand Down

0 comments on commit f829782

Please sign in to comment.