]> git.evergreen-ils.org Git - working/Evergreen.git/commit
LP#1778606 Web Client - Place Hold Requires Two Clicks on Submit
authorDan Briem <dbriem@wlsmail.org>
Fri, 4 Oct 2019 14:57:06 +0000 (10:57 -0400)
committerJason Etheridge <jason@EquinoxInitiative.org>
Mon, 21 Oct 2019 11:19:12 +0000 (07:19 -0400)
commit332588c6c8ef7e19d45ad8036d23303272db5c74
treef762f34e252103c68cf5264891f9973f784faa5d
parent7a4dd1113295f41feb59479a84fa7d2e898906dd
LP#1778606 Web Client - Place Hold Requires Two Clicks on Submit

Issue: the barcode lookup runs on the input's onchange, onkeypress (Enter), &
disables the submit button until the patron loads. So, if you type a barcode,
click enter, click the submit button, mousedown fires, if focus was still the
barcode input, its onchange fires, the lookup runs again, the submit button
disables, prevents button mouseup from firing, the click event is disrupted, &
the form doesn't submit. Click again & it works.

Instead of onchange & onkeypress this branch runs the lookup when there's a
500ms pause between onkeydowns. onpaste and enter still run the lookup
immediately. The patron search triggers the input's keydown instead of change.

To test:
1. Search for any holdable item in the catalog and click Place Hold
2. Type in an existing patron barcode and click Enter
3. Before tabbing or clicking off the barcode input, click the Submit button
4. Note it doesn't submit - click again and it submits
5. Apply patch
6. Repeat steps 1-3
7. Note it submits

Signed-off-by: Dan Briem <dbriem@wlsmail.org>
Signed-off-by: Jason Etheridge <jason@EquinoxInitiative.org>
Open-ILS/src/templates/opac/parts/place_hold.tt2
Open-ILS/web/js/ui/default/opac/staff.js
Open-ILS/web/js/ui/default/staff/cat/catalog/app.js