refactor: put margin in jina template

This commit is contained in:
Prof. Dr. Matthias Jung DL9MJ
2025-06-24 22:04:10 +02:00
committed by Tim Grelka
parent e323954495
commit ea5144cebd
2 changed files with 38 additions and 25 deletions
+19
View File
@@ -0,0 +1,19 @@
<div class="margin {{ type }}" id="margin_for_{{ id }}">
{{ content }}
</div>
<a id="margin_orig_{{ id }}"></a>
<script>
(() => {
function moveFunc() {
const targetEl = document.getElementById(
window.innerWidth > 800 ? "margin_{{ margin_anchor_id }}" : "margin_orig_{{ id }}"
);
targetEl.parentNode.insertBefore(
document.getElementById("margin_for_{{ id }}"),
targetEl
);
}
addEventListener("resize", moveFunc);
moveFunc();
})();
</script>