From dc4763712e0532075ceac141e234f8eeb44c03de Mon Sep 17 00:00:00 2001 From: Eric Fontaine Date: Wed, 21 Jul 2021 00:52:36 -0400 Subject: [PATCH] updateConfig when move sliders too onchange only would trigger updateConfig when user releases the mouse from sliders. Adding oninput also allows updateConfig when dragging the sliders, which provides immediate feedback of the changes for the user. --- index_other.h | 7 ++++++- index_ov2640.h | 5 +++++ index_ov3660.h | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/index_other.h b/index_other.h index 71b6971..1b89aa8 100644 --- a/index_other.h +++ b/index_other.h @@ -254,10 +254,15 @@ const uint8_t index_simple_html[] = R"=====( // Attach default on change action document - .querySelectorAll('.action-setting') + .querySelectorAll('.default-action') .forEach(el => { el.onchange = () => updateConfig(el) }) + document + .querySelectorAll('input[type="range"]') + .forEach(el => { + el.oninput = () => updateConfig(el) + }) // Custom actions // Detection and framesize diff --git a/index_ov2640.h b/index_ov2640.h index 00724cf..f202ec7 100644 --- a/index_ov2640.h +++ b/index_ov2640.h @@ -498,6 +498,11 @@ const uint8_t index_ov2640_html[] = R"=====( .forEach(el => { el.onchange = () => updateConfig(el) }) + document + .querySelectorAll('input[type="range"]') + .forEach(el => { + el.oninput = () => updateConfig(el) + }) // Custom actions // Gain diff --git a/index_ov3660.h b/index_ov3660.h index ff4b88d..ca963c7 100644 --- a/index_ov3660.h +++ b/index_ov3660.h @@ -510,6 +510,11 @@ const uint8_t index_ov3660_html[] = R"=====( .forEach(el => { el.onchange = () => updateConfig(el) }) + document + .querySelectorAll('input[type="range"]') + .forEach(el => { + el.oninput = () => updateConfig(el) + }) // Custom actions // Gain