diff --git a/ui/js/controllers/main.js b/ui/js/controllers/main.js index 6b80931c0..ef169f00a 100644 --- a/ui/js/controllers/main.js +++ b/ui/js/controllers/main.js @@ -67,6 +67,13 @@ treeherder.controller('MainCtrl', [ } else if (ev.keyCode === 85) { //display only unclassified failures, keys:u $scope.toggleUnclassifiedFailures(); + } else if (ev.keyCode === 27) { + // escape key closes any open top-panel and clears selected job + $scope.setRepoPanelShowing(false); + $scope.setFilterPanelShowing(false); + $scope.setSettingsPanelShowing(false); + $scope.setSheriffPanelShowing(false); + $scope.clearJob(); } } }; @@ -200,19 +207,34 @@ treeherder.controller('MainCtrl', [ }); $scope.isRepoPanelShowing = false; - $scope.setRepoPanelShowing = function(tf) { $scope.isRepoPanelShowing = tf; }; + $scope.isFilterPanelShowing = false; + $scope.setFilterPanelShowing = function(tf) { + $scope.isFilterPanelShowing = tf; + }; + + $scope.isSettingsPanelShowing = false; + $scope.setSettingsPanelShowing = function(tf) { + $scope.isSettingsPanelShowing = tf; + }; + + $scope.isSheriffPanelShowing = false; + $scope.setSheriffPanelShowing = function(tf) { + $scope.isSheriffPanelShowing = tf; + }; + $scope.changeRepo = function(repo_name) { // hide the repo panel if they chose to load one. $scope.isRepoPanelShowing = false; $rootScope.selectedJob = null; thPinboard.unPinAll(); + $location.search("repo", repo_name); + $location.search("revision", null); $scope.repoModel.setCurrent(repo_name); - $location.search({repo: repo_name}); }; diff --git a/ui/partials/thGlobalTopNavPanel.html b/ui/partials/thGlobalTopNavPanel.html index d60838b1a..97625ec2c 100644 --- a/ui/partials/thGlobalTopNavPanel.html +++ b/ui/partials/thGlobalTopNavPanel.html @@ -17,7 +17,7 @@ Sheriffing + ng-click="setSheriffPanelShowing(!isSheriffPanelShowing)">Sheriffing Filters + ng-click="setFilterPanelShowing(!isFilterPanelShowing)">Filters Settings + ng-click="setSettingsPanelShowing(!isSettingsPanelShowing)">Settings - +