rem:  var nextNode = null; var numToRemove = tree.selectedItems.length; while (numToRemove > 0) { var selectedNode = tree.selectedItems[0]; nextNode = selectedNode.nextSibling; if (!nextNode) { nextNode = selectedNode.previousSibling; 
add: var sel = tree.treeBoxObject.selection;  var nextNode = -1; var rangeCount = sel.getRangeCount(); for (var range = rangeCount-1; range >= 0; --range) { var min = {}, max = {}; sel.getRangeAt(range, min, max); for (var index = max.value; index >= min.value; --index) { var item = tree.contentView.getItemAtIndex(index); var nextNode = item.nextSibling ? index : -1; item.parentNode.removeChild(item); 
context: function RemovePanel(){  var tree = document.getElementById('current-panels');  var nextNode = null;  var numToRemove = tree.selectedItems.length;  while (numToRemove > 0) {    var selectedNode = tree.selectedItems[0];    nextNode = selectedNode.nextSibling;    if (!nextNode) {      nextNode = selectedNode.previousSibling;    }    selectedNode.parentNode.removeChild(selectedNode);    numToRemove--;  }  if (nextNode) {    tree.selectItem(nextNode)  }  enable_buttons_for_current_panels();}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/a376ddc0531725ad80728692bef9c8ab8b17636c/customize.js/buggy/suite/common/sidebar/customize.js