B2G/gecko/browser/base/content/newtab/dropTargetShim.js
/**
   * Determines the current drop target by matching the dragged site's position
   * against all cells in the grid.
   * @return The currently hovered drop target or null.
   */
Determines the current drop target by matching the dragged site's position
against all cells in the grid.
@return The currently hovered drop target or null.
Determines the current drop target by matching the dragged site ' s position against all cells in the grid . @return The currently hovered drop target or null .
function DropTargetShim_findDropTarget() {
    let minWidth = gDrag.cellWidth / 2;
    let minHeight = gDrag.cellHeight / 2;
    let cellPositions = this._getCellPositions();
    let rect = gTransformation.getNodePosition(gDrag.draggedSite.node);
    for (let i = 0; i < cellPositions.length; i++) {
      let inter = rect.intersect(cellPositions[i].rect);
      if (inter.width >= minWidth && inter.height >= minHeight)
        return cellPositions[i].cell;
    }
    return null;
  }
function DropTargetShim_findDropTarget ( ) { let minWidth = gDrag . cellWidth / 2 ; let minHeight = gDrag . cellHeight / 2 ; let cellPositions = this . _getCellPositions ( ) ; let rect = gTransformation . getNodePosition ( gDrag . draggedSite . node ) ; for ( let i = 0 ; i < cellPositions . length ; i ++ ) { let inter = rect . intersect ( cellPositions [ i ] . rect ) ; if ( inter . width >= minWidth && inter . height >= minHeight ) return cellPositions [ i ] . cell ; } return null ; }
Determines the current drop target by matching the dragged site's position
 against all cells in the grid.
Determines the current drop target by matching the dragged site ' s position against all cells in the grid .
// These are the minimum intersection values - we want to use the cell if // the site is >= 50% hovering its position. // Compare each cell's position to the dragged site's position. // If the intersection is big enough we found a drop target. // No drop target found.