Skip to content

Commit c4960c2

Browse files
authored
Rollup merge of rust-lang#65741 - GuillaumeGomez:help-popup, r=Dylan-DPC
Prevent help popup to disappear when clicking on it Fixes rust-lang#65736. r? @kinnison
2 parents 5e84805 + 863796b commit c4960c2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/librustdoc/html/static/main.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,13 @@ function getSearchElement() {
379379

380380
set_fragment(cur_id);
381381
}
382-
} else if (hasClass(document.getElementById("help"), "hidden") === false) {
383-
addClass(document.getElementById("help"), "hidden");
384-
removeClass(document.body, "blur");
382+
} else if (hasClass(getHelpElement(), "hidden") === false) {
383+
var help = getHelpElement();
384+
var is_inside_help_popup = ev.target !== help && help.contains(ev.target);
385+
if (is_inside_help_popup === false) {
386+
addClass(help, "hidden");
387+
removeClass(document.body, "blur");
388+
}
385389
} else {
386390
// Making a collapsed element visible on onhashchange seems
387391
// too late

0 commit comments

Comments
 (0)