gui: openModal's comments cut down, room in the core budget for #3492
Two comments in openModal say the same in fewer words (25 bytes), so the next commit's quiet redraw of the provider editor (#3492, 23 bytes on today's main) stays inside coreScriptBudget with no raise. Comments only; no behavior changes. What was run: the core's script sizes summed as TestCoreScriptBudget sums them: 1,541,425 of 1,541,427 with the next commit, 1,541,450 without this one. TestCoreScriptBudget itself is run with the next commit (its body).
This commit is contained in:
@@ -8705,14 +8705,14 @@ function openModal(content) {
|
||||
const m = $("#modal"), d = m.firstElementChild;
|
||||
const fresh = m.hidden || m.classList.contains("out");
|
||||
const top = m.hidden ? 0 : d.querySelector(".ebody")?.scrollTop || 0;
|
||||
// Names & levels scrolls inside the editor body, so keep its own position.
|
||||
// Names & levels scrolls inside the body: keep its place.
|
||||
const names = !fresh && d.querySelector(".mnames:not([hidden])");
|
||||
const namesAt = names && { provider: names.dataset.provider, top: names.scrollTop };
|
||||
m.classList.remove("out");
|
||||
d.classList.remove("swap");
|
||||
if (!fresh) { void d.offsetWidth; d.classList.add("swap"); } // content changed: a soft refresh, not a re-entrance
|
||||
frame(content);
|
||||
// an editor that reads long text (a prompt's) takes a wider dialog
|
||||
// an editor of long text (a prompt's) takes a wider dialog
|
||||
d.classList.toggle("wide", content.classList.contains("wide"));
|
||||
// Keep focus through a redraw of an open editor.
|
||||
const active = d.contains(document.activeElement) ? document.activeElement : null;
|
||||
|
||||
Reference in New Issue
Block a user