From: Jakub Vrana Date: Mon, 29 Jan 2018 20:19:11 +0000 (+0100) Subject: Focus correct field in selectSearch X-Git-Tag: v4.6.0~59 X-Git-Url: https://git.joonet.de/?a=commitdiff_plain;h=d28d01e76ca465341aeec01f6764ede7e4a6379f;p=adminer.git Focus correct field in selectSearch --- diff --git a/adminer/static/functions.js b/adminer/static/functions.js index 05b62fcd..4549ec6a 100644 --- a/adminer/static/functions.js +++ b/adminer/static/functions.js @@ -1,10 +1,11 @@ /** Get first element by selector * @param string +* @param [HTMLElement] defaults to document * @return HTMLElement */ -function qs(selector) { - return document.querySelector(selector); +function qs(selector, context) { + return (context || document).querySelector(selector); } /** Get last element by selector