show/hide this revision's text 4 Fixed bug in last version, also now properly sets right or down arrows
function get_arrow_uids(expand_all() {
  // return an array of all row uids that can be toggled
  var arrows = new Array();
  $("#bugGrid tr").each(function(idx, elemrow) {
    var arrows = $("a.arrow[exp=0]", row);
    if (elem.uid row.uid && $("a.arrow", elem).length arrows.length > 0) {
      arrows.push(elem.uid)GridControl.toggleNode(row.uid);      
    }
  });
  return arrowsfalse;
}
function expand_all(collapse_all() {
  $.each(get_arrow_uids(), function(uid) { GridControl.expandNode(uid); });
  return false;
}

function collapse_all(("#bugGrid tr").each(function(idx, row) {
    var arrows = $.each(get_arrow_uids(), function(uid("a.arrow[exp=1]", row);
    if (row.uid && arrows.length > 0) {
      GridControl.collapseNode(uid)GridControl.toggleNode(row.uid);      
    }
  });
  return false;
}
if( window.location.href.indexOf("pg=pgList") > 0 || window.location.href.indexOf("pgx=LF") > 0 || $("#bugGrid" ) )
{
  $("#listNav").prepend("<a id=\"collapse_all\" href=\"#\">Collapse All</a> | <a id=\"expand_all\" href=\"#\">Expand All</a> | ");
}
$("#collapse_all").click(collapse_all);
$("#expand_all").click(expand_all);

This has been working for me in Chrome on FB 8.1 (hosted) I updated it to have explicit expand and collapse links to avoid toggling when a list is partially expanded/collapsed.

show/hide this revision's text 3 fixed link spacing
function get_arrow_uids() {
  // return an array of all row uids that can be toggled
  var arrows = new Array();
  $("#bugGrid tr").each(function(idx, elem) {
    if (elem.uid && $("a.arrow", elem).length > 0) {
      arrows.push(elem.uid);
    }
  });
  return arrows;
}

function expand_all() {
  $.each(get_arrow_uids(), function(uid) { GridControl.expandNode(uid); });
  return false;
}

function collapse_all() {
  $.each(get_arrow_uids(), function(uid) { GridControl.collapseNode(uid); });
  return false;
}

if( window.location.href.indexOf("pg=pgList") > 0 || window.location.href.indexOf("pgx=LF") > 0 || $("#bugGrid" ) )
{
  $("#listNav").prepend("<a id=\"collapse_all\" href=\"#\">Collapse All</a> | <a id=\"expand_all\" href=\"#\">Expand All</a>");
</a> | ");
}
$("#collapse_all").click(collapse_all);
$("#expand_all").click(expand_all);

This has been working for me in Chrome on FB 8.1 (hosted) I updated it to have explicit expand and collapse links to avoid toggling when a list is partially expanded/collapsed.

show/hide this revision's text 2 typos

Instead of calling toggleNode(

function get_arrow_uids() on the GridControl{
  // return an array of all row uids that can be toggled
  var arrows = new Array();
  $("#bugGrid tr").each(function(idx, are there explicit expand(elem) collapse({
    if (elem.uid && $("a.arrow", elem).length > 0) type calls? I'd rather add two links to the listNav, one {
      arrows.push(elem.uid);
    }
  });
  return arrows;
}

function expand_all() {
  $.each(get_arrow_uids(), function(uid) { GridControl.expandNode(uid); });
  return false;
}

function collapse_all() {
  $.each(get_arrow_uids(), function(uid) { GridControl.collapseNode(uid); });
  return false;
}

if( window.location.href.indexOf("pg=pgList") > 0 || window.location.href.indexOf("pgx=LF") > 0 || $("#bugGrid" ) )
{
  $("#listNav").prepend("<a id=\"collapse_all\" href=\"#\">Collapse All</a> | <a id=\"expand_all\" href=\"#\">Expand All</a>");
}
$("#collapse_all").click(collapse_all);
$("#expand_all").click(expand_all);

This has been working for me in Chrome on FB 8.1 (hosted) I updated it to have explicit expand all, and one for collapse all.

The toggle can get into confusing states depending on if a user toggled links to avoid toggling when a few manually, before hitting the toggleAlllist is partially expanded/collapsed.

show/hide this revision's text 1