rem: for (var ii=1; ii < panels.childNodes.length; ii += 2) { 
add: var no_panels_iframe = document.getElementById('sidebar-iframe-no-panels'); if (panels.childNodes.length > 2) { no_panels_iframe.setAttribute('hidden','true'); } else { no_panels_iframe.removeAttribute('hidden'); } for (var ii=2; ii < panels.childNodes.length; ii += 2) { 
context: function update_panels() {  // This function requires that the attributre 'last-selected-panel'  // holds the id of a non-excluded panel. If it doesn't, no panel will  // be selected.  var panels = document.getElementById('sidebar-panels');  var selected_id = panels.getAttribute('last-selected-panel');  var have_set_top = 0;  var have_set_after_selected = 0;  var is_after_selected = 0;  var last_header = 0;  for (var ii=1; ii < panels.childNodes.length; ii += 2) {    var header = panels.childNodes.item(ii);    var content = panels.childNodes.item(ii+1);    var id = header.getAttribute('id');    if (is_excluded(header)) {      debug("item("+ii+") excluded");      header.setAttribute('hidden','true');      content.setAttribute('hidden','true');    } else {      last_header = header;      header.removeAttribute('last-panel');      if (!have_set_top) {        header.setAttribute('top-panel','true');        have_set_top = 1      } else {        header.removeAttribute('top-panel');      }      if (!have_set_after_selected && is_after_selected) {        header.setAttribute('first-panel-after-selected','true');        have_set_after_selected = 1      } else {        header.removeAttribute('first-panel-after-selected');      }      header.removeAttribute('hidden');      if (selected_id == id) {        is_after_selected = 1        debug("item("+ii+") selected");        header.setAttribute('selected', 'true');        content.removeAttribute('hidden');        content.removeAttribute('collapsed');        var previously_shown = content.getAttribute('have-shown');        content.setAttribute('have-shown','true');        if (!previously_shown) {          // Pick sandboxed, or unsandboxed iframe          var iframe = get_iframe(content);          iframe.removeAttribute('hidden');          iframe.addEventListener('load', panel_loader, true);        }      } else {         debug("item("+ii+") unselected");        header.removeAttribute('selected');        content.setAttribute('collapsed','true');      }    }  }  if (last_header) {    last_header.setAttribute('last-panel','true');  }}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/b0d4b27dd4c88e26db8b55643459ff6843ff4b25/sidebarOverlay.js/buggy/xpfe/components/sidebar/resources/sidebarOverlay.js