From 2fd99855101b8996b73057478109ec519976df7a Mon Sep 17 00:00:00 2001 From: Michael Fairchild <mfairchild365@gmail.com> Date: Wed, 2 Sep 2015 09:38:31 -0500 Subject: [PATCH] Tell the parent window to close the results pane on escape key press --- www/js/search.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/www/js/search.js b/www/js/search.js index f54e0a9..6bc1e58 100644 --- a/www/js/search.js +++ b/www/js/search.js @@ -360,6 +360,14 @@ } passiveQuery(q, false); }); + + if (window.parent != undefined) { + $(document).on('keydown', function(e) { + if (!e.keyCode || e.keyCode === 27) { + window.parent.postMessage('wdn.search.close', "*"); + } + }); + } }); }); -- GitLab