rem: var num_selected = 0;  for (var ii=0; ii<all_panels.selectedItems.length; ii++) { debug("counting selected items..."); var node = all_panels.selectedItems[ii]; if (node.getAttribute('container') != 'true') { num_selected++; 
add: var sel = all_panels.treeBoxObject.selection; var num_selected = sel ? sel.count : 0; if (sel) { var ranges = sel.getRangeCount(); for (var range = 0; range < ranges; ++range) { var min = {}, max = {}; sel.getRangeAt(range, min, max); for (var index = min; index <= max; ++index) { var node = all_panels.contentView.getItemAtIndex(index); if (node.getAttribute('container') != 'true') { ++num_selected; } } 
context: function enable_buttons_for_other_panels(){  var add_button = document.getElementById('add_button');  var preview_button = document.getElementById('preview_button');  var all_panels = document.getElementById('other-panels');  var num_selected = 0;  // Only count non-folders as selected for button enabling  for (var ii=0; ii<all_panels.selectedItems.length; ii++) {    debug("counting selected items...");    var node = all_panels.selectedItems[ii];    if (node.getAttribute('container') != 'true') {      num_selected++;    }  }  debug("num_selected="+num_selected);  if (num_selected > 0) {    add_button.removeAttribute('disabled');    preview_button.removeAttribute('disabled');  }  else {    add_button.setAttribute('disabled','true');    preview_button.setAttribute('disabled','true');  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/e0d74dbab0591d49321454ee7cde5f57910c4047/customize.js/buggy/suite/common/sidebar/customize.js