about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-10-24 00:37:14 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-10-24 22:52:54 +0200
commite836b1b9d082d904533c2c7fc510a17fec030182 (patch)
tree3a8c6d1617f8cc6189f141c80fcdfe42a1586cb5
parentf466f52c1bf8f2e4454e31c683a88625ad4b4033 (diff)
Prevent help popup to disappear when clicking on it
-rw-r--r--src/librustdoc/html/static/main.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js
index f0104c9156d..5171190d0dd 100644
--- a/src/librustdoc/html/static/main.js
+++ b/src/librustdoc/html/static/main.js
@@ -380,8 +380,11 @@ function getSearchElement() {
                 set_fragment(cur_id);
             }
         } else if (hasClass(document.getElementById("help"), "hidden") === false) {
-            addClass(document.getElementById("help"), "hidden");
-            removeClass(document.body, "blur");
+            var is_inside_help_popup = document.getElementById("help").contains(ev.target);
+            if (is_inside_help_popup === false) {
+                addClass(document.getElementById("help"), "hidden");
+                removeClass(document.body, "blur");
+            }
         } else {
             // Making a collapsed element visible on onhashchange seems
             // too late