mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-18 23:44:18 +01:00
42 lines
1.4 KiB
HTML
42 lines
1.4 KiB
HTML
{% extends "modal_base.html" %}
|
|
|
|
{% block modal_class %}w-11/12 max-w-[90ch] max-h-[95%] overflow-y-auto{% endblock %}
|
|
|
|
{% block modal_content %}
|
|
{% if text_content.url_info.image_id %}
|
|
<img class="rounded-t-md overflow-clip" src="/file/{{text_content.url_info.image_id}}" alt="Screenshot of the site" />
|
|
{% endif %}
|
|
{% if text_content.file_info.mime_type == "image/png" or text_content.file_info.mime_type == "image/jpeg" %}
|
|
<figure>
|
|
<img src="/file/{{text_content.file_info.id}}" alt="{{text_content.file_info.file_name}}" />
|
|
</figure>
|
|
{% endif %}
|
|
<div id="reader-{{text_content.id}}" class="markdown-content prose" data-content="{{text_content.text | escape }}">
|
|
{{text_content.text | escape }}
|
|
</div>
|
|
|
|
<script>
|
|
(function () {
|
|
const readerElementId = "reader-{{text_content.id}}";
|
|
const contentDiv = document.getElementById(readerElementId);
|
|
|
|
if (!contentDiv) {
|
|
console.error("Markdown content div #" + readerElementId + " not found for processing.");
|
|
return;
|
|
}
|
|
|
|
const scrollableModalContainer = contentDiv.closest('.overflow-y-auto.max-h-\\[95\\%\\]');
|
|
|
|
if (scrollableModalContainer) {
|
|
setTimeout(() => {
|
|
scrollableModalContainer.scrollTop = 0;
|
|
}, 10);
|
|
} else {
|
|
console.warn('Scrollable modal container not found for #', readerElementId);
|
|
}
|
|
})();
|
|
</script>
|
|
{% endblock %}
|
|
|
|
{% block primary_actions %}
|
|
{% endblock %} |