PHP_AdminTool_Projekt/docs/api/js/template.js
blaerf 9f0e534e20 develop (#28)
Co-authored-by: tg95 <tg95@noreply.localhost>
Co-authored-by: Taarly <lownslow.music@gmail.com>
Co-authored-by: taarly <lownslow.music@gmail.com>
Co-authored-by: ViperioN1339 <stezel1989@outlook.de>
Co-authored-by: MuchenTuchen31 <yasin.mine31@gmail.com>
Reviewed-on: https://git.eckertplayground.de/taarly/PHP_AdminTool_Projekt/pulls/28
Co-authored-by: blaerf <blaerf@gmx.de>
Co-committed-by: blaerf <blaerf@gmx.de>
2025-12-17 14:28:04 +00:00

34 lines
1.0 KiB
JavaScript

(function(){
window.addEventListener('load', () => {
const el = document.querySelector('.phpdocumentor-on-this-page__content')
if (!el) {
return;
}
const observer = new IntersectionObserver(
([e]) => {
e.target.classList.toggle("-stuck", e.intersectionRatio < 1);
},
{threshold: [1]}
);
observer.observe(el);
})
})();
function openSvg(svg) {
// convert to a valid XML source
const as_text = new XMLSerializer().serializeToString(svg);
// store in a Blob
const blob = new Blob([as_text], { type: "image/svg+xml" });
// create an URI pointing to that blob
const url = URL.createObjectURL(blob);
const win = open(url);
// so the Garbage Collector can collect the blob
win.onload = (evt) => URL.revokeObjectURL(url);
};
var svgs = document.querySelectorAll(".phpdocumentor-uml-diagram svg");
for( var i=0,il = svgs.length; i< il; i ++ ) {
svgs[i].onclick = (evt) => openSvg(evt.target);
}