Skip to content
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

Make entire row of doc search results clickable #53047

Merged
merged 1 commit into from
Aug 4, 2018
Merged

Make entire row of doc search results clickable #53047

merged 1 commit into from
Aug 4, 2018

Conversation

carols10cents
Copy link
Member

@carols10cents carols10cents commented Aug 3, 2018

By adding empty after content that clears and is display: block.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.

NOTE: THE BELOW IMAGES ARE GIFS BUT I DIDN'T MAKE THEM LOOP, OPEN IN A NEW TAB TO SEE THEM SORRY SORRY

Here's what happens before this change: my mouse cursor is in the middle of the table cell, and the row is highlighted which makes it look like clicking should have an effect, but clicking doesn't do anything:

rustdoc-clicky-clicky-before

After this change, clicking in the middle of the cell works!

rustdoc-clicky-clicky-after

It even works nicely when the type is really long and wraps! (I created the type artificially because I couldn't find a long enough one in the wild)

rustdoc-clicky-clicky-after-long

By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.
@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2018
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Collaborator

r? @QuietMisdreavus

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 3, 2018
@QuietMisdreavus
Copy link
Member

My god, it's beautiful. I didn't even realize how much i wanted this.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 3, 2018

📌 Commit 11ffeed has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 3, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Aug 4, 2018
… r=QuietMisdreavus

Make entire row of doc search results clickable

By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.

NOTE: THE BELOW IMAGES ARE GIFS BUT I DIDN'T MAKE THEM LOOP, OPEN IN A NEW TAB TO SEE THEM SORRY SORRY

Here's what happens before this change: my mouse cursor is in the middle of the table cell, and the row is highlighted which makes it look like clicking should have an effect, but clicking doesn't do anything:

![rustdoc-clicky-clicky-before](https://user-images.githubusercontent.com/193874/43668604-d1e63392-974b-11e8-99f5-e7e11c9056e8.gif)

After this change, clicking in the middle of the cell works!

![rustdoc-clicky-clicky-after](https://user-images.githubusercontent.com/193874/43668616-e522fa08-974b-11e8-8409-3826d586d1f7.gif)

It even works nicely when the type is really long and wraps! (I created the type artificially because I couldn't find a long enough one in the wild)

![rustdoc-clicky-clicky-after-long](https://user-images.githubusercontent.com/193874/43668639-f962a75c-974b-11e8-9218-70bf068387a3.gif)
bors added a commit that referenced this pull request Aug 4, 2018
Rollup of 14 pull requests

Successful merges:

 - #51919 (Provide `{to,from}_{ne,le,be}_bytes` functions on integers)
 - #52940 (Align 6-week cycle check with beta promotion instead of stable release.)
 - #52968 (App-lint-cability)
 - #52969 (rustbuild: fix local_rebuild)
 - #52995 (Remove unnecessary local in await! generator)
 - #52996 (RELEASES.md: fix the `hash_map::Entry::or_default` link)
 - #53001 (privacy: Fix an ICE in `path_is_private_type`)
 - #53003 (Stabilize --color and --error-format options in rustdoc)
 - #53022 (volatile operations docs: clarify that this does not help wrt. concurrency)
 - #53024 (Specify reentrancy gurantees of `Once::call_once`)
 - #53041 (Fix invalid code css rule)
 - #53047 (Make entire row of doc search results clickable)
 - #53050 (Make left column of rustdoc search results narrower)
 - #53062 (Remove redundant field names in structs)
@bors bors merged commit 11ffeed into rust-lang:master Aug 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants