Error Action: render builder directly, remove redundant subtype select
Error Action (tag 82) now renders buildErrorActionRow() directly in onBerTypeChange, bypassing the shared ber-subtype select which had confusing 'Action indicator' option and dead 'Proactive command'/'Custom hex' choices. Removed the now-unreachable type === 'error' branch from onBerSubTypeChange.
This commit is contained in:
+6
-13
@@ -2066,6 +2066,11 @@ function onBerTypeChange(sel) {
|
|||||||
body.innerHTML = `<input class="ber-hex w-full font-mono text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" placeholder="hex" oninput="updateBerRow(this)">`;
|
body.innerHTML = `<input class="ber-hex w-full font-mono text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" placeholder="hex" oninput="updateBerRow(this)">`;
|
||||||
} else if (type === 'chaining') {
|
} else if (type === 'chaining') {
|
||||||
body.innerHTML = buildScriptChainingRow(row.dataset.berIdx);
|
body.innerHTML = buildScriptChainingRow(row.dataset.berIdx);
|
||||||
|
} else if (type === 'error') {
|
||||||
|
body.innerHTML = buildErrorActionRow();
|
||||||
|
const actionType = body.querySelector('.error-action-type');
|
||||||
|
onErrorActionTypeChange(actionType);
|
||||||
|
updateBerRow(sel);
|
||||||
} else {
|
} else {
|
||||||
body.innerHTML = `<div class="flex gap-1 mb-1 flex-wrap">
|
body.innerHTML = `<div class="flex gap-1 mb-1 flex-wrap">
|
||||||
<select class="ber-subtype text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" onchange="onBerSubTypeChange(this)">
|
<select class="ber-subtype text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" onchange="onBerSubTypeChange(this)">
|
||||||
@@ -2142,26 +2147,14 @@ function onBerSubTypeChange(sel) {
|
|||||||
const st = sel.value;
|
const st = sel.value;
|
||||||
|
|
||||||
if (st === 'action') {
|
if (st === 'action') {
|
||||||
const row = sel.closest('.ber-row');
|
|
||||||
const type = row.querySelector('.ber-type').value;
|
|
||||||
|
|
||||||
if (type === 'error') {
|
|
||||||
body.innerHTML = buildErrorActionRow();
|
|
||||||
const actionType = body.querySelector('.error-action-type');
|
|
||||||
onErrorActionTypeChange(actionType);
|
|
||||||
} else {
|
|
||||||
body.innerHTML = `<select class="ber-action text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300 font-mono" onchange="updateBerRow(this)">
|
body.innerHTML = `<select class="ber-action text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300 font-mono" onchange="updateBerRow(this)">
|
||||||
<option value="81">81 (Session indication)</option>
|
<option value="81">81 (Session indication)</option>
|
||||||
<option value="82">82 (Early response)</option>
|
<option value="82">82 (Early response)</option>
|
||||||
</select>`;
|
</select>`;
|
||||||
}
|
|
||||||
} else if (st === 'custom') {
|
} else if (st === 'custom') {
|
||||||
body.innerHTML = `<input class="ber-hex w-full font-mono text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" placeholder="hex" oninput="updateBerRow(this)">`;
|
body.innerHTML = `<input class="ber-hex w-full font-mono text-xs border border-gray-300 dark:border-slate-600 rounded px-1 py-1 dark:bg-slate-700 dark:text-slate-300" placeholder="hex" oninput="updateBerRow(this)">`;
|
||||||
} else {
|
} else {
|
||||||
const row = sel.closest('.ber-row');
|
body.innerHTML = buildBerPcHtml();
|
||||||
const type = row.querySelector('.ber-type').value;
|
|
||||||
const allowed = type === 'error' ? ['display','tone'] : undefined;
|
|
||||||
body.innerHTML = buildBerPcHtml(allowed);
|
|
||||||
const pc = body.querySelector('.ber-pc');
|
const pc = body.querySelector('.ber-pc');
|
||||||
berPopulateDevices(pc);
|
berPopulateDevices(pc);
|
||||||
onBerPcTypeChange(pc.querySelector('.ber-pc-type'));
|
onBerPcTypeChange(pc.querySelector('.ber-pc-type'));
|
||||||
|
|||||||
Reference in New Issue
Block a user