From f167eedc06b11f6c4813b723e4e6deb966486725 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Thu, 28 Jul 2011 11:04:36 -0400 Subject: [PATCH] Only update MARC on full entry of fixed fields AKA: Lang is 3 characters long. Entering 1 character would cause focus to leave. MARC would also update incorrectly. This only triggers the update when the full 3 characters are entered. This not only prevents issues with catalogers editing multi-character fixed fields but also makes it less likely they accidentally corrupt the records. Signed-off-by: Thomas Berezansky Signed-off-by: Mike Rylander --- Open-ILS/xul/staff_client/server/cat/marcedit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/xul/staff_client/server/cat/marcedit.js b/Open-ILS/xul/staff_client/server/cat/marcedit.js index f39401bc37..15ffbc88c8 100644 --- a/Open-ILS/xul/staff_client/server/cat/marcedit.js +++ b/Open-ILS/xul/staff_client/server/cat/marcedit.js @@ -1444,6 +1444,9 @@ function updateFixedFields (element) { var rtype = _record_type; 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; var parts = { ldr : _record.leader, -- 2.11.0