You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by zr...@apache.org on 2020/03/04 13:01:56 UTC
[camel-website] 07/13: update: hide search results when not on focus
This is an automated email from the ASF dual-hosted git repository.
zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-website.git
commit 31916c0aff4370e3046ff44142e29bbbd796076b
Author: nayananga@ubuntu <na...@gmail.com>
AuthorDate: Mon Mar 2 01:10:36 2020 +0530
update: hide search results when not on focus
---
antora-ui-camel/src/js/06-search.js | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/antora-ui-camel/src/js/06-search.js b/antora-ui-camel/src/js/06-search.js
index 30a59f3..a2231f1 100644
--- a/antora-ui-camel/src/js/06-search.js
+++ b/antora-ui-camel/src/js/06-search.js
@@ -80,10 +80,10 @@ window.addEventListener('load', () => {
container.className = 'navbar-search'
})
}, 150))
- window.addEventListener('keyup', (key) => {
- if (key.which === 27) {
+ window.addEventListener('mouseup', debounce((element) => {
+ if (element.target !== container && element.target.parentNode !== container) {
container.className = 'navbar-search results-hidden'
results.innerHTML = ''
}
- })
+ }), 150)
})