function my_init() {
try {
-
/* Initial setup */
if (typeof JSAN == 'undefined') {
// If this is the first barcode on the page
// Set it accordingly to direct focus after load
if (! g.first_focus) {
-
g.first_focus = barcode_textbox;
+ var grab_barcode = barcode_textbox.value;
}
}
if (g.use_defaults && ! g.first_focus) {
-
g.first_focus = barcode_textbox;
barcode_textbox.focus();
}
if (set_handlers) {
-
util.widgets.apply_vertical_tab_on_enter_handler(
barcode_textbox,
function() { setTimeout(function(){util.widgets.vertical_tab(barcode_textbox);},0); },
setTimeout( function() { ev.target.select(); ev.target.focus(); }, 0);
}
}, false);
-
+
barcode_textbox.addEventListener( 'focus', function(ev) { g.last_focus = ev.target; }, false );
}
}
- if (g.first_focus) {
-
+ if (g.first_focus) {
g.first_focus.focus();
}
menulist.addEventListener(
'command',
function(ev) {
-
+ g.first_focus = null;
g.current_lineitem_index = menulist.getIndexOfItem( menulist.selectedItem );
g.reset_lineitem();
g.load_and_render_lineitem_notes(g.lineitem_list[g.current_lineitem_index][0]);
g.summarize( g.existing_copies );
g.render_edit_items_panes();
- document.getElementById(caption.id).focus();
+ document.getElementById(caption.id).focus();
} catch(E) {