From f7cac8c0a7ad1429c0da997feca11bf9eae4c0c6 Mon Sep 17 00:00:00 2001 From: OlgunR Date: Tue, 2 Jun 2026 15:32:42 +0200 Subject: [PATCH] Improve popup layout and CodeMirror integration Updated the `ContentTemplate` to enhance the layout of the `#attachment-content` container by using `display: flex` and ensuring full height utilization. Added CSS rules for consistent styling of the `.CodeMirror` editor, including font size and height adjustments. Simplified CodeMirror initialization for XML files by removing redundant `'); - $content.html('').append(textarea); + // CodeMirror für XML - Container leeren + $content.html(''); // CodeMirror laden (falls noch nicht geladen) if (typeof CodeMirror === 'undefined') { @@ -230,14 +239,22 @@ else } function initCodeMirror(content) { - CodeMirror(document.getElementById('attachment-content'), { + // CodeMirror direkt in den Container einfügen + var editor = CodeMirror($content[0], { value: content, mode: 'xml', lineNumbers: true, readOnly: true, theme: 'monokai', - lineWrapping: true + lineWrapping: true, + viewportMargin: Infinity }); + + // Höhe explizit setzen nach kurzer Verzögerung + setTimeout(function() { + editor.setSize('100%', '100%'); + editor.refresh(); + }, 100); } } else { // Plain Text