B2G/gecko/browser/base/content/sanitizeDialog.js
/**
   * Scrolls the tree so that the grippy row is in the center of the view.
   */
Scrolls the tree so that the grippy row is in the center of the view.
Scrolls the tree so that the grippy row is in the center of the view .
function CSTH_scrollToGrippy()
  {
    var rowCount = this.tree.view.rowCount;
    var tbo = this.tree.treeBoxObject;
    var pageLen = tbo.getPageLength() ||
                  parseInt(this.tree.getAttribute("rows")) ||
                  10;
    if (rowCount <= pageLen)
      return;
    var scrollToRow = this.getGrippyRow() - Math.ceil(pageLen / 2.0);
    if (scrollToRow < 0)
      scrollToRow = 0;
    else if (rowCount < scrollToRow + pageLen)
      scrollToRow = rowCount - pageLen;
    tbo.scrollToRow(scrollToRow);
  }
function CSTH_scrollToGrippy ( ) { var rowCount = this . tree . view . rowCount ; var tbo = this . tree . treeBoxObject ; var pageLen = tbo . getPageLength ( ) || parseInt ( this . tree . getAttribute ( "rows" ) ) || 10 ; if ( rowCount <= pageLen ) return ; var scrollToRow = this . getGrippyRow ( ) - Math . ceil ( pageLen / 2.0 ) ; if ( scrollToRow < 0 ) scrollToRow = 0 ; else if ( rowCount < scrollToRow + pageLen ) scrollToRow = rowCount - pageLen ; tbo . scrollToRow ( scrollToRow ) ; }
Scrolls the tree so that the grippy row is in the center of the view.
Scrolls the tree so that the grippy row is in the center of the view .
// All rows fit on a single page. // Grippy row is in first half of first page. // Grippy row is in last half of last page.