rem: var noneSelected, isFirst, isLast, selectedNode  if (numSelected > 0) { selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex); isFirst = selectedNode == selectedNode.parentNode.firstChild isLast  = selectedNode == selectedNode.parentNode.lastChild 
add: if (numSelected == 1 && tree.view.selection.isSelected(tree.currentIndex)) { var selectedNode = tree.view.getItemAtIndex(tree.currentIndex); customizeURL = selectedNode.getAttribute('customize'); canMoveUp = selectedNode != selectedNode.parentNode.firstChild; canMoveDown = selectedNode != selectedNode.parentNode.lastChild; 
context: function enable_buttons_for_current_panels() {  var up        = document.getElementById('up');  var down      = document.getElementById('down');  var tree      = document.getElementById('current-panels');  var customize = document.getElementById('customize-button');  var remove    = document.getElementById('remove-button');  var numSelected = tree.treeBoxObject.selection ? tree.treeBoxObject.selection.count : 0;  var noneSelected, isFirst, isLast, selectedNode  if (numSelected > 0) {    selectedNode = tree.contentView.getItemAtIndex(tree.currentIndex);    isFirst = selectedNode == selectedNode.parentNode.firstChild    isLast  = selectedNode == selectedNode.parentNode.lastChild  }  // up /\ button  if (numSelected != 1 || isFirst) {    up.setAttribute('disabled', 'true');  } else {    up.removeAttribute('disabled');  }  // down \/ button  if (numSelected != 1 || isLast) {    down.setAttribute('disabled', 'true');  } else {    down.removeAttribute('disabled');  }  // "Customize..." button  var customizeURL = null;  if (numSelected == 1) {    customizeURL = selectedNode.getAttribute('customize');  }  if (customizeURL == null || customizeURL == '') {    customize.setAttribute('disabled','true');  } else {    customize.removeAttribute('disabled');  }  // "Remove" button  if (numSelected == 0) {    remove.setAttribute('disabled','true');  } else {    remove.removeAttribute('disabled');  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/ec7f2bfa878c9f3d3c37847453d69dab25f800e9/customize.js/clean/suite/common/sidebar/customize.js