B2G/gecko/browser/components/downloads/content/downloads.js
/**
   * Opens the downloads panel when data is ready to be displayed.
   */
Opens the downloads panel when data is ready to be displayed.
Opens the downloads panel when data is ready to be displayed .
function DP_openPopupIfDataReady()
  {
    if (this._state != this.kStateShowing || DownloadsView.loading) {
      return;
    }
    DownloadsButton.getAnchor(function DP_OPIDR_callback(aAnchor) {
      if (window.windowState == Ci.nsIDOMChromeWindow.STATE_MINIMIZED) {
        DownloadsButton.releaseAnchor();
        this._state = this.kStateHidden;
        return;
      }
      if (aAnchor) {
        this.panel.openPopup(aAnchor, "bottomcenter topright", 0, 0, false,
                             null);
      } else {
        this.panel.openPopup(document.getElementById("TabsToolbar"),
                             "after_end", 0, 0, false, null);
      }
    }.bind(this));
  }
function DP_openPopupIfDataReady ( ) { if ( this . _state != this . kStateShowing || DownloadsView . loading ) { return ; } DownloadsButton . getAnchor ( function DP_OPIDR_callback ( aAnchor ) { if ( window . windowState == Ci . nsIDOMChromeWindow . STATE_MINIMIZED ) { DownloadsButton . releaseAnchor ( ) ; this . _state = this . kStateHidden ; return ; } if ( aAnchor ) { this . panel . openPopup ( aAnchor , "bottomcenter topright" , 0 , 0 , false , null ) ; } else { this . panel . openPopup ( document . getElementById ( "TabsToolbar" ) , "after_end" , 0 , 0 , false , null ) ; } } . bind ( this ) ) ; }
Opens the downloads panel when data is ready to be displayed.
Opens the downloads panel when data is ready to be displayed .
// We don't want to open the popup if we already displayed it, or if we are // still loading data. // Ensure the anchor is visible.  If that is not possible, show the panel // anchored to the top area of the window, near the default anchor position. // At this point, if the window is minimized, opening the panel could fail // without any notification, and there would be no way to either open or // close the panel anymore.  To prevent this, check if the window is // minimized and in that case force the panel to the closed state.