KMAIN-1328 Cursor at Bottom of Update Items Added code to update_items.js to reset...
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:10:24 +0000 (17:10 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: 09cee90

Open-ILS/xul/staff_client/server/cat/update_items.js

index 5a3fee1..0037d7c 100644 (file)
@@ -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) {