From 6824cde1a684f1a6adea4e2a8d24646efce61009 Mon Sep 17 00:00:00 2001 From: dbs Date: Thu, 26 Aug 2010 12:49:16 +0000 Subject: [PATCH] Spine label editor: make ENTER at the end of a line move to next line git-svn-id: svn://svn.open-ils.org/ILS/trunk@17345 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/server/cat/spine_labels.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Open-ILS/xul/staff_client/server/cat/spine_labels.js b/Open-ILS/xul/staff_client/server/cat/spine_labels.js index 539a10692..dd88df46c 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.js +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.js @@ -300,9 +300,20 @@ * label */ if (sel_start == sel_end) { - /* Special case if the cursor is at the start of the line */ if (sel_start == 0) { + /* If the cursor is at the start of the line: + * insert new line + */ line_value = ' ' + line_value; + } else if (sel_start == line_value.length) { + /* Special case if the cursor is at the end of the line: + * move to next line + */ + var next_row = $(row_id.prefix + (parseInt(row_id.spine) + 1)); + if (next_row) { + next_row.focus(); + } + break; } else { line_value = line_value.substr(0, sel_start) + ' ' + line_value.substr(sel_end); } @@ -405,6 +416,10 @@ } break; } + + default : { + break; + } } } -- 2.11.0