From 6d405b8d81c47cd867f7bd20d3dcd29050622030 Mon Sep 17 00:00:00 2001 From: Simon Hieu Mai Date: Wed, 13 Mar 2013 08:38:47 -0500 Subject: [PATCH] LP#921142: Fill in trailing spaces for fixed fields MARC fixed fields are required to have all positions entered. This patch will fill in the trailing spaces automatic in fields that have more than one position allowed in them. Replace oninput into onblur for all of fixed fields. Signed-off-by: Simon Mai --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 6 +- Open-ILS/xul/staff_client/server/cat/marcedit.xul | 134 +++++++++++----------- 2 files changed, 72 insertions(+), 68 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index 1fbf544dd6..1fa98b07b6 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -819,7 +819,11 @@ function updateFixedFields (element) { var new_value = element.value; // Don't take focus away/adjust the record on partial changes var length = element.getAttribute('maxlength'); - if(new_value.length < length) return true; + + // fill in trailing spaces automatic + for (var i = new_value.length;i < length;i++){ + new_value = new_value + ' '; + } var marc_rec = new MARC.Record ({ delimiter : '$', marcxml : xml_record.toXMLString() }); marc_rec.setFixedField(element.getAttribute('name'), new_value); diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.xul b/Open-ILS/xul/staff_client/server/cat/marcedit.xul index 2fd96890ef..f5f93c5cc7 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.xul +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.xul @@ -80,157 +80,157 @@ - -- 2.11.0