[fix](trx-frontend-http): add missing WEFAX toggle button click handler
The wefax.js plugin defined wefaxToggleBtn but never attached a click event listener, so clicking "Enable WEFAX" did nothing. Also switched the clear button from raw fetch() to postPath() so it includes the remote parameter in multi-rig setups. https://claude.ai/code/session_01UJQpbecEBbphMZkSDKCiY6 Signed-off-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -185,9 +185,25 @@ window.resetWefaxHistoryView = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// --- Button handlers ---
|
// --- Button handlers ---
|
||||||
|
if (wefaxToggleBtn) {
|
||||||
|
wefaxToggleBtn.addEventListener('click', async function () {
|
||||||
|
try {
|
||||||
|
if (window.takeSchedulerControlForDecoderDisable) {
|
||||||
|
await window.takeSchedulerControlForDecoderDisable(wefaxToggleBtn);
|
||||||
|
}
|
||||||
|
await postPath('/toggle_wefax_decode');
|
||||||
|
} catch (e) {
|
||||||
|
console.error('WEFAX toggle failed', e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
if (wefaxClearBtn) {
|
if (wefaxClearBtn) {
|
||||||
wefaxClearBtn.addEventListener('click', function () {
|
wefaxClearBtn.addEventListener('click', async function () {
|
||||||
fetch('/clear_wefax_decode', { method: 'POST' });
|
try {
|
||||||
|
await postPath('/clear_wefax_decode');
|
||||||
window.resetWefaxHistoryView();
|
window.resetWefaxHistoryView();
|
||||||
|
} catch (e) {
|
||||||
|
console.error('WEFAX clear failed', e);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user