aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorGwyneth Morgan <gwymor@tilde.club>2024-01-14 17:42:59 -0800
committerGitHub <noreply@github.com>2024-01-15 09:42:59 +0800
commite5313248a8ed967a915f072d3991b6d046badf02 (patch)
tree858c9d515c7229d1ad6ce22e9a0a875e6706ba00 /templates
parent3f342d6dffb0ef902965192f7ec4713b799c6a67 (diff)
downloadgitea-e5313248a8ed967a915f072d3991b6d046badf02.tar.gz
gitea-e5313248a8ed967a915f072d3991b6d046badf02.zip
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.
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/issue/view_content/reactions.tmpl4
1 files changed, 3 insertions, 1 deletions
diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl
index b7ca943e01..da6319667b 100644
--- a/templates/repo/issue/view_content/reactions.tmpl
+++ b/templates/repo/issue/view_content/reactions.tmpl
@@ -2,7 +2,9 @@
{{range $key, $value := .Reactions}}
{{$hasReacted := $value.HasUser $.ctxData.SignedUserID}}
<a role="button" class="ui label basic{{if $hasReacted}} primary{{end}}{{if not $.ctxData.IsSigned}} disabled{{end}} comment-reaction-button"
- data-tooltip-content="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
+ data-tooltip-content
+ title="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
+ aria-label="{{$value.GetFirstUsers}}{{if gt ($value.GetMoreUserCount) 0}} {{ctx.Locale.Tr "repo.reactions_more" $value.GetMoreUserCount}}{{end}}"
data-tooltip-placement="bottom-start"
data-reaction-content="{{$key}}" data-has-reacted="{{$hasReacted}}">
<span class="reaction">{{ReactionToEmoji $key}}</span>