about summary refs log tree commit diff
path: root/compiler/rustc_errors
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-12 17:19:27 +0200
committerGitHub <noreply@github.com>2021-05-12 17:19:27 +0200
commit90f6fe852b64818cf48375cd47ddde3eafa12cfc (patch)
tree617814cabf661222de0d6090bb579e653eafa99b /compiler/rustc_errors
parent94617802a154560d82f8dc0745219abcd800ff9b (diff)
parent09454513d196613e3e60ab52b7479f9d65d6270a (diff)
downloadrust-90f6fe852b64818cf48375cd47ddde3eafa12cfc.tar.gz
rust-90f6fe852b64818cf48375cd47ddde3eafa12cfc.zip
Rollup merge of #85117 - jsha:bubble-bubble-toil-and-trouble, r=GuillaumeGomez
Move global click handlers to per-element ones.

In rustdoc's main.js, we had an onclick handler for the whole document that would dispatch to handlers for various elements. This change attaches the handlers to the elements that trigger them, instead. This simplifies the code and avoids reimplementing the browser's bubbling functionality.

As part of this change, change from a class to an id for help button.

Move the handlers and associated code for highlighting source lines into source-script.js (and factor out a shared regex).

Demo at https://hoffman-andrews.com/rust/bubble-bubble-toil-and-trouble/std/string/struct.String.html

Note: this conflicts with / depends on #85074. Once that's merged I'll rebase this and resolve conflicts.

Part of #83332. Thanks to `@Manishearth` for the [suggestion to not reimplement bubbling](https://github.com/rust-lang/rust/issues/83332#issuecomment-803497509).

r? `@GuillaumeGomez`
Diffstat (limited to 'compiler/rustc_errors')
0 files changed, 0 insertions, 0 deletions