retrieve_mbts_for_list();
- $('details').addEventListener(
- 'command',
- handle_details,
- false
- );
-
- $('add').addEventListener(
- 'command',
- handle_add,
- false
- );
+ event_listeners();
JSAN.use('util.exec'); var exec = new util.exec(20);
exec.on_error = function(E) { alert(E); return true; }
}
}
+function event_listeners() {
+ $('details').addEventListener(
+ 'command',
+ handle_details,
+ false
+ );
+
+ $('add').addEventListener(
+ 'command',
+ handle_add,
+ false
+ );
+
+ $('payment').addEventListener(
+ 'change',
+ function(ev) { distribute_payment(); },
+ false
+ );
+
+ $('payment').addEventListener(
+ 'keypress',
+ function(ev) {
+ if (! (ev.keyCode == 13 /* enter */ || ev.keyCode == 77 /* mac enter */) ) { return; }
+ distribute_payment();
+ $('apply_payment_btn').focus();
+ },
+ false
+ );
+
+}
+
function $(id) { return document.getElementById(id); }
function default_focus() {
<hbox>
<checkbox id="annotate_payment" label="&staff.patron.bills_overlay.annotate_payment.label;" accesskey="n" oils_persist="checked" checked="false" oncommand="default_focus();"/>
<button label="See Distribution" accesskey="D" oncommand="distribute_payment(); default_focus();"/>
- <button label="Apply Payment" accesskey="P"/>
+ <button id="apply_payment_btn" label="Apply Payment" accesskey="P"/>
</hbox>
</groupbox>
</hbox>