forked from forgejo/forgejo
Remove useless JS operation for relative time tooltips (#20756)
This operation that shifts the content from title to data-content is useless when we can directly render the expected HTML instead. This change does prevent these tooltips from working when the user has JS disabled in their browser, but I think we made it clear by now that JS is required for gitea to work properly. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
74515d3d17
commit
20b3a90450
4 changed files with 4 additions and 12 deletions
|
@ -119,7 +119,7 @@ func TestHtmlTimeSince(t *testing.T) {
|
|||
// test that `diff` yields a result containing `expected`
|
||||
test := func(expected string, diff time.Duration) {
|
||||
actual := htmlTimeSince(BaseDate, BaseDate.Add(diff), translation.NewLocale("en-US"))
|
||||
assert.Contains(t, actual, `title="Sat Jan 1 00:00:00 UTC 2000"`)
|
||||
assert.Contains(t, actual, `data-content="Sat Jan 1 00:00:00 UTC 2000"`)
|
||||
assert.Contains(t, actual, expected)
|
||||
}
|
||||
test("1 second", time.Second)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue