From: dbs Date: Mon, 30 Aug 2010 12:26:04 +0000 (+0000) Subject: Refine the backspace operation in spine label editor X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ece513e776bca0c5cb599c69f87864b88d8703ac;p=evergreen%2Fbjwebb.git Refine the backspace operation in spine label editor Make backspace at the start of a line also move up to the previous row. git-svn-id: svn://svn.open-ils.org/ILS/trunk@17366 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 f742a38e6..5b24e18a0 100644 --- a/Open-ILS/xul/staff_client/server/cat/spine_labels.js +++ b/Open-ILS/xul/staff_client/server/cat/spine_labels.js @@ -380,7 +380,7 @@ case dojo.keys.BACKSPACE : { /* Delete line if at the start of an input box */ - if (sel_start == 0) { + if (sel_start == 0 && sel_end == sel_start) { var new_label = ''; var chunk; var x = 0; @@ -405,6 +405,13 @@ generate({"acn": row_id.acn, "label": new_label}); $(row_id.prefix + row_id.spine).focus(); } + if (sel_start == 0) { + /* Move to the previous row */ + var prev_row = $(row_id.prefix + (parseInt(row_id.spine) - 1)); + if (prev_row) { + prev_row.focus(); + } + } break; }