From: Bill Erickson Date: Wed, 29 Oct 2014 21:10:24 +0000 (-0400) Subject: KMAIN-1328 Cursor at Bottom of Update Items Added code to update_items.js to reset... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d1df8e36caeee296adf280b4e3733f7c0e67f90c;p=working%2FEvergreen.git KMAIN-1328 Cursor at Bottom of Update Items Added code to update_items.js to reset g.first_focus to null when a new lineitem is chosen. The cursor now focuses on the topmost line item copy barcode field when a different line item is chosen from the drop-down results. Signed-off-by: Victoria Lewis Cross-port: 09cee90 --- diff --git a/Open-ILS/xul/staff_client/server/cat/update_items.js b/Open-ILS/xul/staff_client/server/cat/update_items.js index 5a3fee1ca6..0037d7c23e 100644 --- a/Open-ILS/xul/staff_client/server/cat/update_items.js +++ b/Open-ILS/xul/staff_client/server/cat/update_items.js @@ -19,7 +19,6 @@ g.acpl_list = []; function my_init() { try { - /* Initial setup */ if (typeof JSAN == 'undefined') { @@ -810,19 +809,17 @@ g.render_volume_copies = function(barcode_column,acn_id,count,ou_id,row) { // 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); }, @@ -847,13 +844,12 @@ g.render_volume_copies = function(barcode_column,acn_id,count,ou_id,row) { 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(); } @@ -1524,7 +1520,7 @@ g.render_lineitem_dropdown = function() { 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]); @@ -1874,7 +1870,7 @@ g.render_input = function(node,blob) { g.summarize( g.existing_copies ); g.render_edit_items_panes(); - document.getElementById(caption.id).focus(); + document.getElementById(caption.id).focus(); } catch(E) {