Copy item path rather than full use
statement.
This commit is contained in:
parent
b1f8e27b74
commit
81d792f31d
2 changed files with 3 additions and 4 deletions
|
@ -84,11 +84,10 @@ pub(super) fn print_item(cx: &Context<'_>, item: &clean::Item, buf: &mut Buffer,
|
|||
write!(buf, "<a class=\"{}\" href=\"#\">{}</a>", item.type_(), item.name.as_ref().unwrap());
|
||||
write!(
|
||||
buf,
|
||||
"<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"copy path\">\
|
||||
"<button id=\"copy-path\" onclick=\"copy_path(this)\" title=\"Copy item path to clipboard\">\
|
||||
<img src=\"{static_root_path}clipboard{suffix}.svg\" \
|
||||
width=\"19\" height=\"18\" \
|
||||
alt=\"Copy item import\" \
|
||||
title=\"Copy item import to clipboard\">\
|
||||
alt=\"Copy item path\">\
|
||||
</button>",
|
||||
static_root_path = page.get_static_root_path(),
|
||||
suffix = page.resource_suffix,
|
||||
|
|
|
@ -985,7 +985,7 @@ function hideThemeButtonState() {
|
|||
});
|
||||
|
||||
var el = document.createElement('textarea');
|
||||
el.value = 'use ' + path.join('::') + ';';
|
||||
el.value = path.join('::');
|
||||
el.setAttribute('readonly', '');
|
||||
// To not make it appear on the screen.
|
||||
el.style.position = 'absolute';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue