use a more self-descriptive name

This commit is contained in:
tophf 2022-01-13 13:48:55 +03:00
parent ecbf397a78
commit 8f1e8c8e47

View File

@ -138,7 +138,10 @@ function onRuntimeMessage(msg) {
setTimeout(sorter.updateStripes, 0, {onlyWhenColumnsChanged: true}); setTimeout(sorter.updateStripes, 0, {onlyWhenColumnsChanged: true});
} }
function EmbedDialog(El) { /**
* @param {function():Node|string} create
*/
function EmbedDialog(create) {
let shown = false; let shown = false;
return toggle; return toggle;
@ -146,7 +149,7 @@ function EmbedDialog(El) {
if (state && !shown) { if (state && !shown) {
messageBoxProxy.show({ messageBoxProxy.show({
title: t('styleInjectionOrder'), title: t('styleInjectionOrder'),
contents: El(), contents: create(),
className: 'injection-order-dialog center-dialog', className: 'injection-order-dialog center-dialog',
blockScroll: true, blockScroll: true,
}) })
@ -163,12 +166,15 @@ function EmbedDialog(El) {
} }
} }
function Embed(El) { /**
* @param {function():Node|string} create
*/
function Embed(create) {
let el; let el;
return toggle; return toggle;
async function toggle(state) { async function toggle(state) {
if (state) { if (state) {
if (!el) el = El(); if (!el) el = create();
if (!el.parentNode) { if (!el.parentNode) {
document.body.append(el); document.body.append(el);
} }