From 863796be7debb97e79d46aacc6501f1d4a6424ae Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 25 Oct 2019 13:43:25 +0200 Subject: [PATCH] Improve help popup detection --- src/librustdoc/html/static/main.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index 5171190d0dd..b9504224779 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -379,10 +379,11 @@ function getSearchElement() { set_fragment(cur_id); } - } else if (hasClass(document.getElementById("help"), "hidden") === false) { - var is_inside_help_popup = document.getElementById("help").contains(ev.target); + } else if (hasClass(getHelpElement(), "hidden") === false) { + var help = getHelpElement(); + var is_inside_help_popup = ev.target !== help && help.contains(ev.target); if (is_inside_help_popup === false) { - addClass(document.getElementById("help"), "hidden"); + addClass(help, "hidden"); removeClass(document.body, "blur"); } } else {