Bug 17812 - Return focus to barcode field after toggling on-site checkouts

This patch changes the behavior of the checkout form so that after
checking boxes in the "checkout settings" panel the cursor focus is
automatically moved to the barcode field.

To test, apply the patch and enable OnSiteCheckouts and
decreaseLoanHighHolds system preferences.

- Open any patron account in circulation.
- Expand the "Checkout settings" panel.
- Click the label or checkbox for "Automatic renewal", "Don't
  decrease checkout length based on holds" and "On-site checkout"
- Confirm that the focus has moved to the barcode field.

Works as advertised.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Marjorie Barry-Vila <marjorie.barry-vila@ccsr.qc.ca>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Owen Leonard 2017-01-03 15:08:32 +00:00 committed by Kyle M Hall
parent a900a434d5
commit d16bcb70e7
2 changed files with 8 additions and 4 deletions

View file

@ -643,7 +643,7 @@ No patron matched <span class="ex">[% message | html %]</span>
[% IF NEEDSCONFIRMATION %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
[% ELSE %]
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" />
<input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
[% END %]
<label for="auto_renew">Automatic renewal</label>
@ -658,9 +658,9 @@ No patron matched <span class="ex">[% message | html %]</span>
[% END %]
[% ELSE %]
[% IF override_high_holds %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" checked="checked" />
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
[% ELSE %]
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" />
<input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
[% END %]
[% END %]
<label for="override_high_holds">Don't decrease checkout length based on holds</label>
@ -677,7 +677,7 @@ No patron matched <span class="ex">[% message | html %]</span>
<input type="hidden" name="onsite_checkout" checked="checked" value="1" />
</div>
[% ELSE %]
<input type="checkbox" id="onsite_checkout" name="onsite_checkout" /> <label for="onsite_checkout">On-site checkout</label>
<input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
[% END %]
</div>
[% END %]

View file

@ -77,6 +77,10 @@ $(document).ready(function() {
}
});
$(".circ_setting").on("click",function(){
$("#barcode").focus();
});
});
function export_checkouts(format) {