-
Notifications
You must be signed in to change notification settings - Fork 13.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent help popup to disappear when clicking on it #65741
Conversation
r? @Dylan-DPC |
src/librustdoc/html/static/main.js
Outdated
var is_inside_help_popup = false; | ||
do { | ||
x = findParentElement(x, "DIV"); | ||
if (x) { | ||
x = x.parentNode; | ||
} | ||
if (x && x.tagName === "ASIDE") { | ||
is_inside_help_popup = true; | ||
break; | ||
} | ||
} while(x); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this entire loop be replaced with:
var is_inside_help_popup = document.getElementById("help").contains(ev.target);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GuillaumeGomez after making this change, ping me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kinnison Awesome! :o
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd not, I hadn't tested that, but I assume @GuillaumeGomez has.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I'm wondering about something, let me check it further!
59766c1
to
e836b1b
Compare
Updated! |
Please not merged, I need to check something! (I wonder if clicking on the background will dismiss the popup as expected with my last change...) |
So just like I thought, it didn't make the help popup disappear, I updated the code a bit. |
Again, I can follow the JS and convince myself it ought to work, but I don't have a test environment right now to actually try it out, so a weak 👍 from me. |
r? @Dylan-DPC |
@bors r+ rollup |
📌 Commit 863796b has been approved by |
Prevent help popup to disappear when clicking on it Fixes rust-lang#65736. r? @kinnison
Rollup of 12 pull requests Successful merges: - #65405 (Create new error E0742 and add long error explanation) - #65539 (resolve: Turn the "non-empty glob must import something" error into a lint) - #65724 (ci: refactor pr tools job skipping) - #65741 (Prevent help popup to disappear when clicking on it) - #65832 (Re-enable Emscripten's exception handling support) - #65843 (Enable dist for MIPS64 musl targets) - #65898 (add basic HermitCore support within libtest) - #65900 (proc_macro: clean up bridge::client::__run_expand{1,2} a bit.) - #65906 (Update mdbook to 0.3.3) - #65920 (Use rustc-workspace-hack for rustbook) - #65930 (doc: use new feature gate for c_void type) - #65936 (save-analysis: Account for async desugaring in async fn return types) Failed merges: - #65434 (Add long error explanation for E0577) r? @ghost
Fixes #65736.
r? @kinnison