bin/XULRunner21_0/modules/PopupNotifications.jsm
/**
   * Updates the notification state in response to window activation or tab
   * selection changes.
   */
Updates the notification state in response to window activation or tab
selection changes.
Updates the notification state in response to window activation or tab selection changes .
function PopupNotifications_update(anchor) {
    if (this.iconBox) {
      this._hideIcons();
    }
    let anchorElement, notificationsToShow = [];
    let currentNotifications = this._currentNotifications;
    let haveNotifications = currentNotifications.length > 0;
    if (haveNotifications) {
      anchorElement = anchor || currentNotifications[0].anchorElement;
      if (this.iconBox) {
        this._showIcons(currentNotifications);
        this.iconBox.hidden = false;
      }
      notificationsToShow = currentNotifications.filter(function (n) {
        return !n.dismissed && n.anchorElement == anchorElement &&
               !n.options.neverShow;
      });
    }
    if (notificationsToShow.length > 0) {
      this._showPanel(notificationsToShow, anchorElement);
    } else {
      this._notify("updateNotShowing");
      this._dismiss();
      if (this.iconBox && !haveNotifications)
        this.iconBox.hidden = true;
    }
  }
function PopupNotifications_update ( anchor ) { if ( this . iconBox ) { this . _hideIcons ( ) ; } let anchorElement , notificationsToShow = [ ] ; let currentNotifications = this . _currentNotifications ; let haveNotifications = currentNotifications . length > 0 ; if ( haveNotifications ) { anchorElement = anchor || currentNotifications [ 0 ] . anchorElement ; if ( this . iconBox ) { this . _showIcons ( currentNotifications ) ; this . iconBox . hidden = false ; } notificationsToShow = currentNotifications . filter ( function ( n ) { return ! n . dismissed && n . anchorElement == anchorElement && ! n . options . neverShow ; } ) ; } if ( notificationsToShow . length > 0 ) { this . _showPanel ( notificationsToShow , anchorElement ) ; } else { this . _notify ( "updateNotShowing" ) ; this . _dismiss ( ) ; if ( this . iconBox && ! haveNotifications ) this . iconBox . hidden = true ; } }
Updates the notification state in response to window activation or tab
 selection changes.
Updates the notification state in response to window activation or tab selection changes .
// hide icons of the previous tab. // Only show the notifications that have the passed-in anchor (or the // first notification's anchor, if none was passed in). Other // notifications will be shown once these are dismissed. // Also filter out notifications that have been dismissed. // Notify observers that we're not showing the popup (useful for testing) // Dismiss the panel if needed. _onPopupHidden will ensure we never call // a dismissal handler on a notification that's been removed. // Only hide the iconBox if we actually have no notifications (as opposed // to not having any showable notifications)