GUAC-586: Do not show tab levels which have only one tab.

This commit is contained in:
Michael Jumper
2015-09-02 15:46:59 -07:00
parent 36c1c853f9
commit 361e985ae1
6 changed files with 21 additions and 25 deletions

View File

@@ -223,6 +223,24 @@ angular.module('navigation').directive('guacPageList', [function guacPageList()
// Add all page definitions
angular.forEach(pages, addPage);
// Filter to only relevant levels
$scope.levels = $scope.levels.filter(function isRelevant(level) {
// Determine relevancy by counting the number of pages
var pageCount = 0;
for (var name in level) {
// Level is relevant if it has two or more pages
if (++pageCount === 2)
return true;
}
// Otherwise, the level is not relevant
return false;
});
});
}] // end controller

View File

@@ -1,4 +1,4 @@
<div class="page-list">
<div class="page-list" ng-show="levels.length">
<!--
Copyright (C) 2015 Glyptodon LLC