From 730f41675601848de5dec0374e0a6df4d16c5ce3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 8 Jan 2015 06:59:26 -0500 Subject: [PATCH] Bug 13537 - Focus should move to barcode after renewing via checkouts table Koha's checkout screen automatically focuses on the barcode field each time it is loaded. Since we've moved the checkouts table functions for renewing and returning items to ajax methods, this page is no longer refreshed, and thus does not refocus to the barcode after performing those actions. This should be fixed so that renewing/returning items via the checkouts page moves the focus to the barcode field. Test Plan: 1) Find a patron with checkouts. 2) Renew or return a checkout, note the focus does not move to the barcode. 3) Apply this patch. 4) Renew or return a checkout, note the focus *does* move to the barcode. Signed-off-by: Kyle M Hall Signed-off-by: Thomas Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit 91f67dde130c1c5c34174a588696bad1286823ad) Signed-off-by: Chris Cormack --- koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js index 356d1cae4b..71d2be25df 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/checkouts.js @@ -117,6 +117,11 @@ $(document).ready(function() { }, "json") }); + // Refocus on barcode field if it exists + if ( $("#barcode").length ) { + $("#barcode").focus(); + } + // Prevent form submit return false; }); -- 2.39.5