docs(*): don't hide results for middle-clicks
Middle-clicking opens a link in a new tab; it shouldn't close the results list as the user may want to open more of those links. Closes #16233
This commit is contained in:
@@ -67,6 +67,12 @@ angular.module('search', [])
|
||||
clearResults();
|
||||
$scope.q = '';
|
||||
};
|
||||
|
||||
$scope.handleResultClicked = function($event) {
|
||||
if ($event.which === 1 && !$event.ctrlKey && !$event.metaKey) {
|
||||
$scope.hideResults();
|
||||
}
|
||||
};
|
||||
}])
|
||||
|
||||
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
<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">
|
||||
<h4 class="search-results-group-heading">{{ key }}</h4>
|
||||
<ul class="search-results">
|
||||
<li ng-repeat="item in value" class="search-result"><a ng-click="hideResults()" ng-href="{{ item.path }}">{{ item.name }}</a></li>
|
||||
<li ng-repeat="item in value" class="search-result"><a ng-click="handleResultClicked($event)" ng-href="{{ item.path }}">{{ item.name }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user