From c3f2670154d66df5c73814fdc71fe171c9526ea4 Mon Sep 17 00:00:00 2001 From: pines Date: Fri, 23 Feb 2007 19:04:42 +0000 Subject: [PATCH] auto-select last added row regardless whether it was appended or prepended git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@7013 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/list.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/list.js b/Open-ILS/xul/staff_client/chrome/content/util/list.js index 283716b764..f90a95fc8e 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/list.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/list.js @@ -337,18 +337,20 @@ util.list.prototype = { var treeitem = document.createElement('treeitem'); treeitem.setAttribute('retrieve_id',params.retrieve_id); - //if (typeof params.to_bottom != 'undefined') { - if (typeof params.to_top == 'undefined') { + if (typeof params.to_bottom != 'undefined') { treechildren_node.appendChild( treeitem ); + if (typeof params.no_auto_select == 'undefined') { + try { obj.node.view.selection.select(Number(obj.node.view.rowCount)-1); } catch(E) { obj.error.sdump('D_ALERT','tree auto select: ' + E + '\n'); } + } } else { if (treechildren_node.firstChild) { treechildren_node.insertBefore( treeitem, treechildren_node.firstChild ); } else { treechildren_node.appendChild( treeitem ); } - } - if (typeof params.no_auto_select == 'undefined') { - try { obj.node.view.selection.select(0); } catch(E) { obj.error.sdump('D_ERROR','tree auto select: ' + E + '\n'); } + if (typeof params.no_auto_select == 'undefined') { + try { obj.node.view.selection.select(0); } catch(E) { obj.error.sdump('D_ALERT','tree auto select: ' + E + '\n'); } + } } var treerow = document.createElement('treerow'); treeitem.appendChild( treerow ); -- 2.11.0