B2G/gecko/browser/base/content/newtab/dropPreview.js
/**
   * Finds the index of the last cell that is empty or contains an unpinned
   * site. These are considered to be of a lower priority.
   * @param aSites The array of sites.
   * @param aCell The drop target cell.
   * @return The cell's index.
   */
Finds the index of the last cell that is empty or contains an unpinned
site. These are considered to be of a lower priority.
@param aSites The array of sites.
@param aCell The drop target cell.
@return The cell's index.
Finds the index of the last cell that is empty or contains an unpinned site . These are considered to be of a lower priority . @param aSites The array of sites . @param aCell The drop target cell . @return The cell ' s index .
function DropPreview_indexOfLowerPrioritySite(aSites, aCell) {
    let cells = gGrid.cells;
    let dropIndex = aCell.index;
    for (let i = cells.length - 1; i >= 0; i--) {
      if (i == dropIndex)
        continue;
      let site = aSites[i];
      if (!site || !site.isPinned())
        return i;
    }
    return -1;
  }
function DropPreview_indexOfLowerPrioritySite ( aSites , aCell ) { let cells = gGrid . cells ; let dropIndex = aCell . index ; for ( let i = cells . length - 1 ; i >= 0 ; i -- ) { if ( i == dropIndex ) continue ; let site = aSites [ i ] ; if ( ! site || ! site . isPinned ( ) ) return i ; } return - 1 ; }
Finds the index of the last cell that is empty or contains an unpinned
 site.
Finds the index of the last cell that is empty or contains an unpinned site .
// Search (beginning with the last site in the grid) for a site that is // empty or unpinned (an thus lower-priority) and can be pushed out of the // grid instead of the pinned site. // The cell that is our drop target is not a good choice. // We can use the cell only if it's empty or the site is un-pinned.