diff options
author | Giteabot <teabot@gitea.io> | 2024-01-12 10:45:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-12 10:45:07 +0800 |
commit | 9f0c709637c30241224784a7c5e0f376c6b958ef (patch) | |
tree | 9ff62b4e14ce6adfe20830cb0bb8e85d0051727d | |
parent | 5e9fd0ab5e3ce6428d6fe93c0c477fadb918e11f (diff) | |
download | gitea-9f0c709637c30241224784a7c5e0f376c6b958ef.tar.gz gitea-9f0c709637c30241224784a7c5e0f376c6b958ef.zip |
Show description as tooltip instead of title for labels (#28754) (#28766)
Backport #28754 by @delvh
Follow GitHubs behavior of showing the label description as a tooltip
instead of the browser native title.
## Before

## After

Co-authored-by: delvh <dev.lh@web.de>
-rw-r--r-- | modules/templates/util_render.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/templates/util_render.go b/modules/templates/util_render.go index 84c3a1587a..639d58126c 100644 --- a/modules/templates/util_render.go +++ b/modules/templates/util_render.go @@ -143,7 +143,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) template.HTML { if labelScope == "" { // Regular label - s := fmt.Sprintf("<div class='ui label' style='color: %s !important; background-color: %s !important' title='%s'>%s</div>", + s := fmt.Sprintf("<div class='ui label' style='color: %s !important; background-color: %s !important' data-tooltip-content title='%s'>%s</div>", textColor, label.Color, description, RenderEmoji(ctx, label.Name)) return template.HTML(s) } @@ -177,7 +177,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) template.HTML { itemColor := "#" + hex.EncodeToString(itemBytes) scopeColor := "#" + hex.EncodeToString(scopeBytes) - s := fmt.Sprintf("<span class='ui label scope-parent' title='%s'>"+ + s := fmt.Sprintf("<span class='ui label scope-parent' data-tooltip-content title='%s'>"+ "<div class='ui label scope-left' style='color: %s !important; background-color: %s !important'>%s</div>"+ "<div class='ui label scope-right' style='color: %s !important; background-color: %s !important'>%s</div>"+ "</span>", |