Skip to content

Commit e285e7b

Browse files
committed
fix adding components not working in message creator
1 parent 168c2d3 commit e285e7b

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

frontend/static/js/messagecreator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -417,8 +417,8 @@
417417
function showCompError(msg) { if (els.compError) els.compError.textContent = msg || ""; }
418418

419419

420-
// touch: a field changed — refresh the preview without rebuilding the editor (keeps input
421-
// focus). rebuild: structure changed — re-render the whole builder.
420+
// refreshPreview: a field changed — refresh the preview without rebuilding the editor (keeps
421+
// input focus). rebuildEditor: structure changed — re-render the whole builder.
422422
function refreshPreview() { renderPreview(); }
423423
function rebuildEditor() { renderBuilder(); renderPreview(); }
424424

@@ -428,7 +428,7 @@
428428
let j = idx + delta;
429429
if (j < 0 || j >= list.length) return;
430430
let tmp = list[idx]; list[idx] = list[j]; list[j] = tmp;
431-
(onChange || rebuild)();
431+
(onChange || rebuildEditor)();
432432
}
433433

434434
function renderBuilder() {
@@ -466,7 +466,7 @@
466466
}
467467

468468
function nodeHeader(title, list, idx, onChange) {
469-
onChange = onChange || rebuild;
469+
onChange = onChange || rebuildEditor;
470470
let tools = el("div", { class: "mc-node-tools" }, [
471471
btn('<i class="fas fa-arrow-up"></i>', "btn-sm btn-secondary", function () { move(list, idx, -1, onChange); }, { title: "Move up" }),
472472
btn('<i class="fas fa-arrow-down"></i>', "btn-sm btn-secondary", function () { move(list, idx, 1, onChange); }, { title: "Move down" }),

0 commit comments

Comments
 (0)