Skip to content

Commit 96a9e15

Browse files
authored
Show language name on hover (#20923)
Each repo has a bar which shows the used programming languages. If you want to know, what language is behind a color, you need to click the bar. With this PR, you just need to hover over the color the view the name.
1 parent b8818a1 commit 96a9e15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/repo/sub_menu.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</div>
4040
<a class="ui segment language-stats">
4141
{{range .LanguageStats}}
42-
<div class="bar" style="width: {{.Percentage}}%; background-color: {{.Color}}">&nbsp;</div>
42+
<div class="bar tooltip" style="width: {{.Percentage}}%; background-color: {{.Color}}" data-placement="top" data-content={{ .Language }}>&nbsp;</div>
4343
{{end}}
4444
</a>
4545
{{end}}

web_src/js/modules/tippy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import tippy from 'tippy.js';
33
export function createTippy(target, opts = {}) {
44
const instance = tippy(target, {
55
appendTo: document.body,
6-
placement: 'top-start',
6+
placement: target.getAttribute('data-placement') || 'top-start',
77
animation: false,
88
allowHTML: false,
99
maxWidth: 500, // increase over default 350px

0 commit comments

Comments
 (0)