Skip to content

Commit e531324

Browse files
authored
Add non-JS fallback for reaction tooltips (#28785)
When JavaScript is not loaded, fall back to displaying reaction tooltips with the default browser `title` attribute. An element with a present but empty `data-tooltip-content` will use the `title` attribute for its tippy.js tooltip content, so when JavaScript is enabled, this functions the same as the current behavior.
1 parent 3f342d6 commit e531324

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templates/repo/issue/view_content/reactions.tmpl

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
{{range $key, $value := .Reactions}}
33
{{$hasReacted := $value.HasUser $.ctxData.SignedUserID}}
44
<a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not $.ctxData.IsSigned}} disabled{{end}} comment-reaction-button"
5-
data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
5+
data-tooltip-content
6+
title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
7+
aria-label="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
68
data-tooltip-placement="bottom-start"
79
data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
810
<span class="reaction">{{ReactionToEmoji $key}}</span>

0 commit comments

Comments
 (0)