From 620c59efcbf173222bfcb59c5700a9c76b36cb6b Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 18 Apr 2015 01:28:08 -0700 Subject: [PATCH] GUAC-1053: Only show the list of settings tabs if more than one is available. --- .../app/settings/controllers/settingsController.js | 11 +++++++++++ .../main/webapp/app/settings/templates/settings.html | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/guacamole/src/main/webapp/app/settings/controllers/settingsController.js b/guacamole/src/main/webapp/app/settings/controllers/settingsController.js index ce1a26aef..7608f5f9a 100644 --- a/guacamole/src/main/webapp/app/settings/controllers/settingsController.js +++ b/guacamole/src/main/webapp/app/settings/controllers/settingsController.js @@ -46,6 +46,17 @@ angular.module('manage').controller('settingsController', ['$scope', '$injector' */ $scope.activeTab = $routeParams.tab; + /** + * Returns whether the list of all available settings tabs should be shown. + * + * @returns {Boolean} + * true if the list of available settings tabs should be shown, false + * otherwise. + */ + $scope.showAvailableTabs = function showAvailableTabs() { + return !!$scope.settingsPages && $scope.settingsPages.length > 1; + }; + // Retrieve settings pages userPageService.getSettingsPages() .then(function settingsPagesRetrieved(pages) { diff --git a/guacamole/src/main/webapp/app/settings/templates/settings.html b/guacamole/src/main/webapp/app/settings/templates/settings.html index 4ba42a616..3c7f26e84 100644 --- a/guacamole/src/main/webapp/app/settings/templates/settings.html +++ b/guacamole/src/main/webapp/app/settings/templates/settings.html @@ -29,7 +29,7 @@ THE SOFTWARE.
- +