From 6fbaf6cec686cfe25b2186799ed7b0368aa1cc6f Mon Sep 17 00:00:00 2001 From: Steven Chan Date: Thu, 23 May 2013 15:22:15 -0700 Subject: [PATCH 1/1] Patron Editor can enter erroneous values for Claims-returned count In the staff client, Patrons interface, Edit screen, when mouse-scrolling up and down the Edit form, it is possible to inadvertently change the value in Claims-returned Count or Claims Never Checked Out Count field. It will happen if the mouse hovers over either data field while using the mouse wheel. Both data fields use the dijit.form.NumberSpinner widget to provide a 'spin' behaviour. The fix involves cancelling the mouse scroll event as it propagates to input fields in table rows that are using the dijit.form.NumberSpinner widget, because the mouse scroll would be applied too early by the widget, before the user has intentionally focussed on one of the input fields. Now, mouse scrolling has no effect on the two input fields; it will only have an effect in scrolling the page up or down. Signed-off-by: Steven Chan Signed-off-by: Ben Shum --- Open-ILS/web/js/ui/default/actor/user/register.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index b62c3b6992..58c2c7080a 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -300,6 +300,17 @@ function load() { } uUpdateContactInvalidators(); + + // Cancel mouse scroll events from propagating to table rows which are + // using the dijit.form.NumberSpinner widget, because the mouse scroll + // would be applied too early by the widget, before the user has + // intentionally focussed on the input field. + dojo.query('tr[wclass="dijit.form.NumberSpinner"]').forEach(function (tr) { + tr.addEventListener('DOMMouseScroll', function (ev) { + ev.stopPropagation(); + }, true); + }); + lock_ready = true; } -- 2.43.2