From c2a382f6a0293aac50717c696a8dd610920a969d Mon Sep 17 00:00:00 2001 From: fabioswartz Date: Thu, 29 Dec 2016 06:17:29 +0000 Subject: [PATCH] Fixing bug with search box --- _embed/public/css/styles.css | 3 ++- _embed/public/js/application.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/_embed/public/css/styles.css b/_embed/public/css/styles.css index 2504e2fc..d2fbb744 100644 --- a/_embed/public/css/styles.css +++ b/_embed/public/css/styles.css @@ -674,6 +674,7 @@ header p i { #search i { margin-right: 0.3em; color: rgba(255, 255, 255, .5); + user-select: none; } #search input { @@ -1357,4 +1358,4 @@ i.spin { #toolbar p { display: none; } -} \ No newline at end of file +} diff --git a/_embed/public/js/application.js b/_embed/public/js/application.js index 3ae44ce8..b77f3f23 100644 --- a/_embed/public/js/application.js +++ b/_embed/public/js/application.js @@ -582,6 +582,12 @@ document.addEventListener('listing', event => { document.querySelector('#search > div div').innerHTML = "Search or use one of your supported commands: " + user.Commands.join(", ") + "."; document.querySelector('#search input').addEventListener('keyup', searchEvent); + + document.querySelector("#search").addEventListener("click", event => { + if(event.target.classList.contains("active") || event.target.classList.contains("material-icons")) return; + event.target.classList.add("active"); + document.querySelector("#search input").focus(); + }); } if (user.AllowEdit) {