This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,12 @@ angular.module('search', [])
67
67
clearResults ( ) ;
68
68
$scope . q = '' ;
69
69
} ;
70
+
71
+ $scope . handleResultClicked = function ( $event ) {
72
+ if ( $event . which === 1 && ! $event . ctrlKey && ! $event . metaKey ) {
73
+ $scope . hideResults ( ) ;
74
+ }
75
+ } ;
70
76
} ] )
71
77
72
78
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ <h1 class="brand"><a href="http://angularjs.org"><img width="117" height="30" sr
132
132
< div ng-repeat ="(key, value) in results track by key " class ="search-results-group " ng-class ="colClassName + ' col-group-' + key " ng-show ="value.length > 0 ">
133
133
< h4 class ="search-results-group-heading "> {{ key }}</ h4 >
134
134
< ul class ="search-results ">
135
- < li ng-repeat ="item in value " class ="search-result "> < a ng-click ="hideResults( ) " ng-href ="{{ item.path }} "> {{ item.name }}</ a > </ li >
135
+ < li ng-repeat ="item in value " class ="search-result "> < a ng-click ="handleResultClicked($event ) " ng-href ="{{ item.path }} "> {{ item.name }}</ a > </ li >
136
136
</ ul >
137
137
</ div >
138
138
</ div >
You can’t perform that action at this time.
0 commit comments