[open-ils-commits] r17345 - trunk/Open-ILS/xul/staff_client/server/cat (dbs)

svn at svn.open-ils.org svn at svn.open-ils.org
Thu Aug 26 08:49:17 EDT 2010


Author: dbs
Date: 2010-08-26 08:49:16 -0400 (Thu, 26 Aug 2010)
New Revision: 17345

Modified:
   trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
Log:
Spine label editor: make ENTER at the end of a line move to next line


Modified: trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-08-26 03:49:20 UTC (rev 17344)
+++ trunk/Open-ILS/xul/staff_client/server/cat/spine_labels.js	2010-08-26 12:49:16 UTC (rev 17345)
@@ -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;
+                }
             }
         }
 



More information about the open-ils-commits mailing list