From: dbs Date: Thu, 26 Aug 2010 12:49:16 +0000 (+0000) Subject: Spine label editor: make ENTER at the end of a line move to next line X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6824cde1a684f1a6adea4e2a8d24646efce61009;p=evergreen%2Fbjwebb.git 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 --- 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; + } } }