]> source.dussan.org Git - gitea.git/commit
Clipboard copy enhancements (#27669) (#27681)
authorGiteabot <teabot@gitea.io>
Wed, 18 Oct 2023 16:23:28 +0000 (00:23 +0800)
committerGitHub <noreply@github.com>
Wed, 18 Oct 2023 16:23:28 +0000 (00:23 +0800)
commit0b8b0072a2b3348b896029d9ba032a980a3496e1
tree7aebd3eab70cedf7927196a84ec9b492fa70184e
parentdab40cd5f4dd1ea4a273775f085f03761127d184
Clipboard copy enhancements (#27669) (#27681)

Backport #27669 by @silverwind

1. Do not show temporary tooltips that are triggered from within
dropdowns. Previously this resulted in the tooltip being stuck to
top-left of the page like seen on issue comment URL copy. I could not
figure out any tippy options that prevent this, so I think it's better
to just not show it.
1. Refactor `initGlobalCopyToClipboardListener` so that it does not run
a often useless `document.querySelector` on every click, make
`data-clipboard-text-type` work with `data-clipboard-target`. No use in
current code base but still good to have. Finally some minor code
cleanup in the function.

Point 1 is for this copy button:

<img width="229" alt="image"
src="https://github.com/go-gitea/gitea/assets/115237/81f34746-8ea5-43d9-8c6f-f6f417a9e4ad">

Co-authored-by: silverwind <me@silverwind.io>
web_src/js/features/clipboard.js
web_src/js/modules/tippy.js