From da6ae8b4b6ad6f902e2ea7fea2dd944f4bd190dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Wed, 20 Sep 2017 14:59:53 +0200 Subject: [PATCH] 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 --- docs/app/src/search.js | 6 ++++++ docs/config/templates/app/indexPage.template.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/app/src/search.js b/docs/app/src/search.js index 1be6614f3846..c239e5d5675c 100644 --- a/docs/app/src/search.js +++ b/docs/app/src/search.js @@ -67,6 +67,12 @@ angular.module('search', []) clearResults(); $scope.q = ''; }; + + $scope.handleResultClicked = function($event) { + if ($event.which === 1 && !$event.ctrlKey && !$event.metaKey) { + $scope.hideResults(); + } + }; }]) diff --git a/docs/config/templates/app/indexPage.template.html b/docs/config/templates/app/indexPage.template.html index e779942cc115..3a543381f9b5 100644 --- a/docs/config/templates/app/indexPage.template.html +++ b/docs/config/templates/app/indexPage.template.html @@ -132,7 +132,7 @@

{{ key }}