fix a Down action bug in Configure Toolbars
authorJason Etheridge <jason@esilibrary.com>
Wed, 28 Mar 2012 19:19:42 +0000 (15:19 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Wed, 28 Mar 2012 19:32:34 +0000 (15:32 -0400)
where the list selection index could be set to an invalid value, which could
cause errors for actions acting upon that index

Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/server/admin/toolbar.js

index 8e899be..8a0e17a 100644 (file)
@@ -303,6 +303,7 @@ function populate_list2_list3(list3_idx) {
 
         if (list3_idx) {
             if (list3_idx < 0) { list3_idx = 0; }
+            if (list3_idx >= g.list3.node.view.rowCount) { list3_idx = g.list3.node.view.rowCount - 1; }
             g.list3.node.view.selection.select(list3_idx);
         }