Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix #688
  • Loading branch information
gashcrumb committed Oct 29, 2013
1 parent aed7a2c commit b377812
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
18 changes: 13 additions & 5 deletions hawtio-web/src/main/webapp/app/core/js/help.ts
Expand Up @@ -2,14 +2,22 @@ module Core {
export function HelpController($scope, $routeParams, marked, helpRegistry, branding) {

$scope.branding = branding;

$scope.topics = helpRegistry.getTopics();
$scope.topic = $routeParams.topic;
$scope.subTopic = Object.extended($scope.topics[$scope.topic]).keys().at(0);
if (angular.isDefined($routeParams.subtopic)) {
$scope.subTopic = $routeParams.subtopic

if ('topic' in $routeParams) {
$scope.topic = $routeParams['topic'];
} else {
$scope.topic = 'index';
}

if ('subtopic' in $routeParams) {
$scope.subTopic = $routeParams['subtopic'];
} else {
$scope.subTopic = Object.extended($scope.topics[$scope.topic]).keys().first();
}

log.debug("topic: ", $scope.topic, " subtopic: ", $scope.subTopic);

// when on the index pages, filter the user subTopic unless on the dev page
var isIndex = $scope.topic === "index";
var filterSubTopic = $scope.subTopic;
Expand Down
3 changes: 2 additions & 1 deletion hawtio-web/src/main/webapp/app/core/js/helpRegistry.ts
Expand Up @@ -100,7 +100,8 @@ module Core {
angular.forEach(this.topics, (value, key) => {
if (value.isValid()) {
log.debug(key, " is available");
answer[key] = value;
// strip out any functions...
answer[key] = angular.fromJson(angular.toJson(value));
} else {
log.debug(key, " is not available");
}
Expand Down

0 comments on commit b377812

Please sign in to comment.