loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Make time tooltips interactive (#23526)

Fixes https://codeberg.org/forgejo/forgejo/issues/511

<img width="379" alt="Screenshot 2023-03-16 at 20 23 10"
src="https://user-images.githubusercontent.com/115237/225731294-4c6e4f44-bdcc-4c8c-86e2-49f7c03b377d.png">

authored by

silverwind and committed by
GitHub
272cf6a2 4b722068

+3 -2
+2 -2
modules/timeutil/since.go
··· 233 233 } 234 234 235 235 func htmlTimeSince(then, now time.Time, lang translation.Locale) template.HTML { 236 - return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s">%s</span>`, 236 + return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s" data-tooltip-interactive="true">%s</span>`, 237 237 then.In(setting.DefaultUILocation).Format(GetTimeFormat(lang.Language())), 238 238 timeSince(then, now, lang))) 239 239 } ··· 244 244 } 245 245 246 246 func htmlTimeSinceUnix(then, now TimeStamp, lang translation.Locale) template.HTML { 247 - return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s">%s</span>`, 247 + return template.HTML(fmt.Sprintf(`<span class="time-since tooltip" data-content="%s" data-tooltip-interactive="true">%s</span>`, 248 248 then.FormatInLocation(GetTimeFormat(lang.Language()), setting.DefaultUILocation), 249 249 timeSinceUnix(int64(then), int64(now), lang))) 250 250 }
+1
web_src/js/modules/tippy.js
··· 33 33 content, 34 34 delay: 100, 35 35 role: 'tooltip', 36 + ...(el.getAttribute('data-tooltip-interactive') === 'true' ? {interactive: true} : {}), 36 37 ...props, 37 38 }); 38 39 }