Commit 55a00be4 authored by vertighel's avatar vertighel
Browse files

bias input readony

parent c9d77b88
Loading
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -284,8 +284,16 @@ document.addEventListener('DOMContentLoaded', () => {

        const applyBias = () => {
            const isBias = imagetypeEl.value === 'Bias';
            exptimeEl.disabled = isBias;
            if (isBias) exptimeEl.value = '0';
            // readonly, not disabled: a disabled input is excluded from the
            // form's values (readForm() would find exptime missing), while
            // readonly still reads back normally and just blocks editing.
            exptimeEl.readOnly = isBias;
            if (isBias) {
                exptimeEl.tabIndex = -1;
                exptimeEl.value = '0';
            } else {
                exptimeEl.removeAttribute('tabindex');
            }
        };
        imagetypeEl.addEventListener('change', applyBias);
        applyBias();