From 3d1d3654020dc08a441c15dee731cae739772fd5 Mon Sep 17 00:00:00 2001 From: Dan Reuther Date: Fri, 17 Jul 2015 12:33:10 -0400 Subject: [PATCH] KMAIN-1643 Text Cursor Automatically Placed on Vendor Invoice ID Set the focus to the Vendor Invoice ID field on invoice create and view screens. Signed-off-by: Dan Reuther modified: Open-ILS/web/js/ui/default/acq/invoice/view.js --- Open-ILS/web/js/ui/default/acq/invoice/view.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Open-ILS/web/js/ui/default/acq/invoice/view.js b/Open-ILS/web/js/ui/default/acq/invoice/view.js index 4888d5e77a..283e6f62c3 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/view.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/view.js @@ -87,6 +87,13 @@ function init2() { dojo.byId('acq-invoice-summary-toggle-on').onclick = function() { openils.Util.show(dojo.byId('acq-invoice-summary')); + + // Set the focus to the Vendor Invoice ID field. Might be a bit brittle since the + // element ID is generated dynamically by a dojo widget. It should be ok since it + // sets the focus to the first element which seems to be the logical place. + // This sets the focus when the invoice brief is displayed by the toggle button. + // It is also set a few line down for the initial page load. + document.getElementById('dijit_form_ValidationTextBox_0').focus(); openils.Util.hide(dojo.byId('acq-invoice-summary-small')); } @@ -120,6 +127,9 @@ function init2() { parentNode : dojo.byId('acq-invoice-extra-copies-fund') }); extraCopiesFund.build(); + + // Set the initial focus field. See comment above for additional notes + document.getElementById('dijit_form_ValidationTextBox_0').focus(); } function renderInvoice() { -- 2.11.0