escape clears open panels and selected job

This commit is contained in:
Cameron Dawson 2014-07-23 09:14:46 -07:00
Родитель ed47c56a9f
Коммит 45937e9b5a
2 изменённых файлов: 28 добавлений и 6 удалений

Просмотреть файл

@ -67,6 +67,13 @@ treeherder.controller('MainCtrl', [
} else if (ev.keyCode === 85) { } else if (ev.keyCode === 85) {
//display only unclassified failures, keys:u //display only unclassified failures, keys:u
$scope.toggleUnclassifiedFailures(); $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.isRepoPanelShowing = false;
$scope.setRepoPanelShowing = function(tf) { $scope.setRepoPanelShowing = function(tf) {
$scope.isRepoPanelShowing = 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) { $scope.changeRepo = function(repo_name) {
// hide the repo panel if they chose to load one. // hide the repo panel if they chose to load one.
$scope.isRepoPanelShowing = false; $scope.isRepoPanelShowing = false;
$rootScope.selectedJob = null; $rootScope.selectedJob = null;
thPinboard.unPinAll(); thPinboard.unPinAll();
$location.search("repo", repo_name);
$location.search("revision", null);
$scope.repoModel.setCurrent(repo_name); $scope.repoModel.setCurrent(repo_name);
$location.search({repo: repo_name});
}; };

Просмотреть файл

@ -17,7 +17,7 @@
<span ng-show="user.is_staff"> <span ng-show="user.is_staff">
<span class="btn btn-view-nav" <span class="btn btn-view-nav"
ng-class="{'active': (isSheriffPanelShowing)}" ng-class="{'active': (isSheriffPanelShowing)}"
ng-click="isSheriffPanelShowing=!isSheriffPanelShowing"><span>Sheriffing</span> ng-click="setSheriffPanelShowing(!isSheriffPanelShowing)"><span>Sheriffing</span>
<i class="glyphicon glyphicon-chevron-down lightgray" <i class="glyphicon glyphicon-chevron-down lightgray"
ng-hide="isSheriffPanelShowing"></i> ng-hide="isSheriffPanelShowing"></i>
<i class="glyphicon glyphicon-chevron-up lightgray" <i class="glyphicon glyphicon-chevron-up lightgray"
@ -35,7 +35,7 @@
</span> </span>
<span class="btn btn-view-nav" <span class="btn btn-view-nav"
ng-class="{'active': (isFilterPanelShowing)}" ng-class="{'active': (isFilterPanelShowing)}"
ng-click="isFilterPanelShowing=!isFilterPanelShowing"><span>Filters</span> ng-click="setFilterPanelShowing(!isFilterPanelShowing)"><span>Filters</span>
<i class="glyphicon glyphicon-chevron-down lightgray" <i class="glyphicon glyphicon-chevron-down lightgray"
ng-hide="isFilterPanelShowing"></i> ng-hide="isFilterPanelShowing"></i>
<i class="glyphicon glyphicon-chevron-up lightgray" <i class="glyphicon glyphicon-chevron-up lightgray"
@ -46,7 +46,7 @@
<!--TODO: change this condition to enable the settings panel--> <!--TODO: change this condition to enable the settings panel-->
<span ng-show="false" class="btn btn-view-nav" <span ng-show="false" class="btn btn-view-nav"
ng-class="{'active': (isSettingsPanelShowing)}" ng-class="{'active': (isSettingsPanelShowing)}"
ng-click="isSettingsPanelShowing=!isSettingsPanelShowing"><span>Settings</span> ng-click="setSettingsPanelShowing(!isSettingsPanelShowing)"><span>Settings</span>
<i class="glyphicon glyphicon-chevron-down lightgray" <i class="glyphicon glyphicon-chevron-down lightgray"
ng-hide="isSettingsPanelShowing"></i> ng-hide="isSettingsPanelShowing"></i>
<i class="glyphicon glyphicon-chevron-up lightgray" <i class="glyphicon glyphicon-chevron-up lightgray"
@ -54,7 +54,7 @@
</span> </span>
<persona-buttons></persona-buttons> <persona-buttons></persona-buttons>
</span> </span>
</span>
</div> </div>
<ng-include class="watched-repo-navbar" src="'partials/thWatchedRepoNavPanel.html'" ng-show="locationPath==='jobs'"> <ng-include class="watched-repo-navbar" src="'partials/thWatchedRepoNavPanel.html'" ng-show="locationPath==='jobs'">