Rollup merge of #107391 - notriddle:notriddle/copy-path-button, r=GuillaumeGomez
rustdoc: remove inline javascript from copy-path button
This commit is contained in:
commit
6bd09e0cd6
@ -1142,7 +1142,11 @@ function loadCss(cssUrl) {
|
|||||||
(function() {
|
(function() {
|
||||||
let reset_button_timeout = null;
|
let reset_button_timeout = null;
|
||||||
|
|
||||||
window.copy_path = but => {
|
const but = document.getElementById("copy-path");
|
||||||
|
if (!but) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
but.onclick = () => {
|
||||||
const parent = but.parentElement;
|
const parent = but.parentElement;
|
||||||
const path = [];
|
const path = [];
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<a href="{{component.path|safe}}index.html">{{component.name}}</a>::<wbr>
|
<a href="{{component.path|safe}}index.html">{{component.name}}</a>::<wbr>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
<a class="{{item_type}}" href="#">{{name}}</a> {#- -#}
|
<a class="{{item_type}}" href="#">{{name}}</a> {#- -#}
|
||||||
<button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"> {#- -#}
|
<button id="copy-path" title="Copy item path to clipboard"> {#- -#}
|
||||||
<img src="{{static_root_path|safe}}{{clipboard_svg}}" {# -#}
|
<img src="{{static_root_path|safe}}{{clipboard_svg}}" {# -#}
|
||||||
width="19" height="18" {# -#}
|
width="19" height="18" {# -#}
|
||||||
alt="Copy item path"> {#- -#}
|
alt="Copy item path"> {#- -#}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user