Better keyboard handling and show score on results

This commit is contained in:
Joseph Schorr 2015-04-07 12:11:16 -04:00
parent 951b0cbab8
commit 55a2c54ab6
3 changed files with 13 additions and 3 deletions

View file

@ -156,9 +156,13 @@ nav.navbar-default .navbar-nav>li>a.active {
vertical-align: middle; vertical-align: middle;
} }
.header-bar-element .search-results li a { .header-bar-element .search-results li .score:before {
color: black; content: "Score: ";
text-decoration: none !important; }
.header-bar-element .search-results li .score {
float: right;
color: #ccc;
} }
.header-bar-element .search-results li .result-name { .header-bar-element .search-results li .result-name {

View file

@ -101,6 +101,7 @@
ng-class="searchResultState.current == $index ? 'current' : ''" ng-class="searchResultState.current == $index ? 'current' : ''"
ng-click="showResult(result)"> ng-click="showResult(result)">
<span class="kind">{{ result.kind }}</span> <span class="kind">{{ result.kind }}</span>
<span class="score">{{ result.score }}</span>
<span ng-switch on="result.kind"> <span ng-switch on="result.kind">
<!-- Team --> <!-- Team -->
<span ng-switch-when="team"> <span ng-switch-when="team">

View file

@ -91,6 +91,11 @@ angular.module('quay').directive('headerBar', function () {
}; };
$scope.handleSearchKeyDown = function(e) { $scope.handleSearchKeyDown = function(e) {
if (e.keyCode == 27) {
$scope.toggleSearch();
return;
}
if (!$scope.searchResultState) { return; } if (!$scope.searchResultState) { return; }
if (e.keyCode == 40) { if (e.keyCode == 40) {