1
Fork 0

Copy item path rather than full use statement.

This commit is contained in:
moxian 2021-07-16 03:45:27 +00:00
parent b1f8e27b74
commit 81d792f31d
2 changed files with 3 additions and 4 deletions

View file

@ -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, "<a class=\"{}\" href=\"#\">{}</a>", item.type_(), item.name.as_ref().unwrap());
write!( write!(
buf, 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\" \ <img src=\"{static_root_path}clipboard{suffix}.svg\" \
width=\"19\" height=\"18\" \ width=\"19\" height=\"18\" \
alt=\"Copy item import\" \ alt=\"Copy item path\">\
title=\"Copy item import to clipboard\">\
</button>", </button>",
static_root_path = page.get_static_root_path(), static_root_path = page.get_static_root_path(),
suffix = page.resource_suffix, suffix = page.resource_suffix,

View file

@ -985,7 +985,7 @@ function hideThemeButtonState() {
}); });
var el = document.createElement('textarea'); var el = document.createElement('textarea');
el.value = 'use ' + path.join('::') + ';'; el.value = path.join('::');
el.setAttribute('readonly', ''); el.setAttribute('readonly', '');
// To not make it appear on the screen. // To not make it appear on the screen.
el.style.position = 'absolute'; el.style.position = 'absolute';