B2G/gecko/browser/devtools/tilt/Tilt.jsm
/**
   * Starts destroying a specific instance of the visualizer.
   *
   * @param {String} aId
   *                 the identifier of the instance in the visualizers array
   * @param {Boolean} aAnimateFlag
   *                  optional, set to true to display a destruction transition
   */
Starts destroying a specific instance of the visualizer.
@param {String} aId
the identifier of the instance in the visualizers array
@param {Boolean} aAnimateFlag
optional, set to true to display a destruction transition
Starts destroying a specific instance of the visualizer . @param { String } aId the identifier of the instance in the visualizers array @param { Boolean } aAnimateFlag optional set to true to display a destruction transition
function T_destroy(aId, aAnimateFlag)
  {
    if (!this.visualizers[aId] || this._isDestroying) {
      return;
    }
    this._isDestroying = true;
    let controller = this.visualizers[aId].controller;
    let presenter = this.visualizers[aId].presenter;
    let content = presenter.contentWindow;
    let pageXOffset = content.pageXOffset * presenter.transforms.zoom;
    let pageYOffset = content.pageYOffset * presenter.transforms.zoom;
    TiltUtils.setDocumentZoom(this.chromeWindow, presenter.transforms.zoom);
    if (!aAnimateFlag) {
      this._finish(aId);
      return;
    }
    Services.obs.notifyObservers(null, TILT_NOTIFICATIONS.DESTROYING, null);
    controller.removeEventListeners();
    controller.arcball.reset([-pageXOffset, -pageYOffset]);
    presenter.executeDestruction(this._finish.bind(this, aId));
  }
function T_destroy ( aId , aAnimateFlag ) { if ( ! this . visualizers [ aId ] || this . _isDestroying ) { return ; } this . _isDestroying = true ; let controller = this . visualizers [ aId ] . controller ; let presenter = this . visualizers [ aId ] . presenter ; let content = presenter . contentWindow ; let pageXOffset = content . pageXOffset * presenter . transforms . zoom ; let pageYOffset = content . pageYOffset * presenter . transforms . zoom ; TiltUtils . setDocumentZoom ( this . chromeWindow , presenter . transforms . zoom ) ; if ( ! aAnimateFlag ) { this . _finish ( aId ) ; return ; } Services . obs . notifyObservers ( null , TILT_NOTIFICATIONS . DESTROYING , null ) ; controller . removeEventListeners ( ) ; controller . arcball . reset ( [ - pageXOffset , - pageYOffset ] ) ; presenter . executeDestruction ( this . _finish . bind ( this , aId ) ) ; }
Starts destroying a specific instance of the visualizer.
Starts destroying a specific instance of the visualizer .
// if the visualizer is destroyed or destroying, don't do anything // if we're not doing any outro animation, just finish destruction directly // otherwise, trigger the outro animation and notify necessary observers