Skip to content

Commit abfdaef

Browse files
authored
Show description as tooltip instead of title for labels (#28754)
Follow GitHubs behavior of showing the label description as a tooltip instead of the browser native title. ## Before ![grafik](https://github.com/go-gitea/gitea/assets/51889757/70448327-467b-4bee-b799-40a442a5ce16) ## After ![grafik](https://github.com/go-gitea/gitea/assets/51889757/abe7d700-148b-4cef-a487-6b0f8f20b212)
1 parent 669bbba commit abfdaef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/templates/util_render.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) template.HTML {
143143

144144
if labelScope == "" {
145145
// Regular label
146-
s := fmt.Sprintf("<div class='ui label' style='color: %s !important; background-color: %s !important' title='%s'>%s</div>",
146+
s := fmt.Sprintf("<div class='ui label' style='color: %s !important; background-color: %s !important' data-tooltip-content title='%s'>%s</div>",
147147
textColor, label.Color, description, RenderEmoji(ctx, label.Name))
148148
return template.HTML(s)
149149
}
@@ -177,7 +177,7 @@ func RenderLabel(ctx context.Context, label *issues_model.Label) template.HTML {
177177
itemColor := "#" + hex.EncodeToString(itemBytes)
178178
scopeColor := "#" + hex.EncodeToString(scopeBytes)
179179

180-
s := fmt.Sprintf("<span class='ui label scope-parent' title='%s'>"+
180+
s := fmt.Sprintf("<span class='ui label scope-parent' data-tooltip-content title='%s'>"+
181181
"<div class='ui label scope-left' style='color: %s !important; background-color: %s !important'>%s</div>"+
182182
"<div class='ui label scope-right' style='color: %s !important; background-color: %s !important'>%s</div>"+
183183
"</span>",

0 commit comments

Comments
 (0)