B2G/gecko/browser/base/content/newtab/transformations.js
/**
   * Slides the given site to the target node's position.
   * @param aSite The site to move.
   * @param aTarget The slide target.
   * @param aOptions Set of options (see below).
   *        unfreeze - unfreeze the site after sliding
   *        callback - the callback to call when finished
   */
Slides the given site to the target node's position.
@param aSite The site to move.
@param aTarget The slide target.
@param aOptions Set of options .
unfreeze - unfreeze the site after sliding
callback - the callback to call when finished
Slides the given site to the target node ' s position . @param aSite The site to move . @param aTarget The slide target . @param aOptions Set of options . unfreeze - unfreeze the site after sliding callback - the callback to call when finished
function Transformation_slideSiteTo(aSite, aTarget, aOptions) {
    let currentPosition = this.getNodePosition(aSite.node);
    let targetPosition = this.getNodePosition(aTarget.node)
    let callback = aOptions && aOptions.callback;
    let self = this;
    function finish() {
      if (aOptions && aOptions.unfreeze)
        self.unfreezeSitePosition(aSite);
      if (callback)
        callback();
    }
    targetPosition.left += this._cellBorderWidths.left;
    targetPosition.top += this._cellBorderWidths.top;
    if (currentPosition.left == targetPosition.left &&
        currentPosition.top == targetPosition.top) {
      finish();
    } else {
      this.setSitePosition(aSite, targetPosition);
      this._whenTransitionEnded(aSite.node, finish);
    }
  }
function Transformation_slideSiteTo ( aSite , aTarget , aOptions ) { let currentPosition = this . getNodePosition ( aSite . node ) ; let targetPosition = this . getNodePosition ( aTarget . node ) let callback = aOptions && aOptions . callback ; let self = this ; function finish ( ) { if ( aOptions && aOptions . unfreeze ) self . unfreezeSitePosition ( aSite ) ; if ( callback ) callback ( ) ; } targetPosition . left += this . _cellBorderWidths . left ; targetPosition . top += this . _cellBorderWidths . top ; if ( currentPosition . left == targetPosition . left && currentPosition . top == targetPosition . top ) { finish ( ) ; } else { this . setSitePosition ( aSite , targetPosition ) ; this . _whenTransitionEnded ( aSite . node , finish ) ; } }
Slides the given site to the target node's position.
Slides the given site to the target node ' s position .
// We need to take the width of a cell's border into account. // Nothing to do here if the positions already match.