[GIT] Evergreen ILS branch main updated. 620b4ec28636e6bc615901eb3db975586983a00d

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via 620b4ec28636e6bc615901eb3db975586983a00d (commit) from 2fb16362eccea81a1b4a3c4d3caeba866be161b7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 620b4ec28636e6bc615901eb3db975586983a00d Author: Stephanie Leary <stephanie.leary@equinoxoli.org> Date: Fri Jun 6 21:02:56 2025 +0000 LP2111948 Focus on code first when adding subfield When adding a new subfield in the MARC rich editor, focus should move to the empty subfield code input first. Focus should also move to the code when pressing the right or left arrow key in a focused subfield group where the code is empty. Release-note: Focuses on subfield code input rather than value when the code is empty (as when adding a new subfield). Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org> Signed-off-by: Elizabeth Davis <elizabeth.davis@sparkpa.org> Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org> diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor-context.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor-context.ts index 1df38c3658..4d58bc0f66 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor-context.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor-context.ts @@ -249,7 +249,7 @@ export class MarcEditContext { if (action.subfield) { const prevPos = action.subfield[2] - 1; action.field.deleteExactSubfields(action.subfield); - this.focusSubfield(action.field, prevPos, true); + this.focusSubfield(action.field, prevPos, 'group'); } else { this.record.deleteFields(action.field); @@ -265,7 +265,7 @@ export class MarcEditContext { if (action.subfield) { this.insertSubfield(action.field, action.subfield, true); - this.focusSubfield(action.field, action.subfield[2]); + this.focusSubfield(action.field, action.subfield[2], 'sfv'); } else { @@ -429,7 +429,7 @@ export class MarcEditContext { field.subfields.splice(position, 0, subfield); if (!skipTracking) { - this.focusSubfield(field, position); + this.focusSubfield(field, position, 'sfc'); this.trackStructuralUndo(field, true, subfield); } } @@ -440,15 +440,12 @@ export class MarcEditContext { } // Focus the requested subfield by its position. - focusSubfield(field: MarcField, position: number, group?: boolean) { + focusSubfield(field: MarcField, position: number, target?: MARC_EDITABLE_FIELD_TYPE | "group" | "move") { // console.debug("focusSubfield()", field, position, group); const focus: FieldFocusRequest = {fieldId: field.fieldId, target: 'sfv'}; - if (group) { - focus.target = 'group'; - } else if (position < 0) { - // Focus the code instead of the value - focus.target = 'sfc'; + if (target) { + focus.target = target; } focus.sfOffset = position; @@ -463,7 +460,7 @@ export class MarcEditContext { field.deleteExactSubfields(subfield); - this.focusSubfield(field, sfpos, true); + this.focusSubfield(field, sfpos, 'group'); } focusTag(field: MarcField) { diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts index cc32d9d071..94b12eeb91 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts @@ -222,10 +222,11 @@ export class MarcRichEditorComponent implements OnInit { if (el.nodeName && (el.nodeName.toLowerCase() === 'input' || el.nodeName.toLowerCase() === 'textarea')) { return; } - // otherwise, move focus from the group to its first input (the subfield code) + // otherwise, move focus from the group to the subfield code if it's empty, or the value if not evt.preventDefault(); evt.stopPropagation(); - this.context.focusSubfield(field, subfield[2], false); + const target = subfield[0] == ' ' ? 'sfc' : 'sfv'; + this.context.focusSubfield(field, subfield[2], target); break; // all remaining shortcuts duplicated from editable-content.component.ts ----------------------------------------------------------------------- Summary of changes: .../eg2/src/app/staff/share/marc-edit/editor-context.ts | 17 +++++++---------- .../app/staff/share/marc-edit/rich-editor.component.ts | 5 +++-- 2 files changed, 10 insertions(+), 12 deletions(-) hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User