Files
gitea-pages/docs/javascripts/tooltip-init.js
armborst_f e6d94157b5
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 26s
test instant preview
2026-03-03 23:42:50 +01:00

15 lines
411 B
JavaScript

document$.subscribe(({ document }) => {
const elements = document.querySelectorAll("[data-image-tooltip]")
elements.forEach(el => {
const img = el.getAttribute("data-image-tooltip")
if (el._tooltipInitialized) return
el._tooltipInitialized = true
window.document$.app?.tooltip?.create(el, {
html: `<img src="${img}" style="max-width:200px;">`,
interactive: true
})
})
})