From fd0d96b349bb26236e52f8479c424b7e3deaf896 Mon Sep 17 00:00:00 2001 From: mwiegand Date: Sun, 17 May 2026 02:25:52 +0200 Subject: [PATCH] fix(editor-v2): eliminate first-paint flicker Three changes that together stop the page from briefly painting the raw textareas before cm6 takes over: 1. base.html gains a {% block extra_head %}{% endblock %} hook. 2. blueprint_detail.html and overlay_detail.html include _editor_assets.html via that extra_head block instead of inside {% block content %}. Editor CSS now loads from , so the textarea pre-hide rule (added below) applies before first paint; the defer'd scripts also download in parallel with HTML parse, which is the better default anyway. 3. editor.css adds textarea[data-editor-language] { display: none; } so opt-in textareas are hidden from the very first paint. editor.js + _editor_assets.html cover the three paths the pre-hide must not break: - bundle didn't load: top-of-IIFE bails early and un-hides every matching textarea via style.display = "revert". - per-textarea mount throws: init()'s catch un-hides that specific textarea so the form stays usable. - JS disabled entirely: _editor_assets.html ships a diff --git a/l4d2web/l4d2web/templates/base.html b/l4d2web/l4d2web/templates/base.html index 1bb21ae..601fdc7 100644 --- a/l4d2web/l4d2web/templates/base.html +++ b/l4d2web/l4d2web/templates/base.html @@ -9,6 +9,7 @@ + {% block extra_head %}{% endblock %}