B2G/gecko/browser/base/content/test/newtab/head.js
/**
 * Simulates a drop and drop operation.
 * @param aDropIndex The cell index of the drop target.
 * @param aDragIndex The cell index containing the dragged site (optional).
 */
Simulates a drop and drop operation.
@param aDropIndex The cell index of the drop target.
@param aDragIndex The cell index containing the dragged site (optional).
Simulates a drop and drop operation . @param aDropIndex The cell index of the drop target . @param aDragIndex The cell index containing the dragged site ( optional ) .
function simulateDrop(aDropIndex, aDragIndex) {
  let draggedSite;
  let {gDrag: drag, gDrop: drop} = getContentWindow();
  let event = createDragEvent("drop", "http://example.com/#99\nblank");
  if (typeof aDragIndex != "undefined")
    draggedSite = getCell(aDragIndex).site;
  if (draggedSite)
    drag.start(draggedSite, event);
  whenPagesUpdated();
  drop.drop(getCell(aDropIndex), event);
  if (draggedSite)
    drag.end(draggedSite);
}
function simulateDrop ( aDropIndex , aDragIndex ) { let draggedSite ; let { gDrag : drag , gDrop : drop } = getContentWindow ( ) ; let event = createDragEvent ( "drop" , "http://example.com/#99\nblank" ) ; if ( typeof aDragIndex != "undefined" ) draggedSite = getCell ( aDragIndex ) . site ; if ( draggedSite ) drag . start ( draggedSite , event ) ; whenPagesUpdated ( ) ; drop . drop ( getCell ( aDropIndex ) , event ) ; if ( draggedSite ) drag . end ( draggedSite ) ; }
Simulates a drop and drop operation.
Simulates a drop and drop operation .