~extension-hackers/messagingmenu-extension/trunk

« back to all changes in this revision

Viewing changes to res/modules/MessagingMenuModule.jsm

  • Committer: Chris Coulson
  • Date: 2012-08-27 00:25:42 UTC
  • Revision ID: chris.coulson@canonical.com-20120827002542-0ebzj9s828b9611d
When cancelling indicators, actually delete them from our indicator list too

Show diffs side-by-side

added added

removed removed

Lines of Context:
910
910
  },
911
911
 
912
912
  hideIndicator: function MME_hideIndicator(aIndicator) {
913
 
    aIndicator.hide();
914
 
 
915
 
    let savedCount = aIndicator.newCount;
916
 
    aIndicator.cancelAttention();
917
 
    aIndicator.newCount = 0;
918
 
 
919
 
    let oldBadgeCount = this.badgeCount;
 
913
    delete this.mIndicators[aIndicator.folderURL];
 
914
    aIndicator.destroy();
 
915
 
920
916
    this.refreshBadgeCount();
921
 
    if (oldBadgeCount != (this.badgeCount + savedCount)) {
922
 
      WARN("The badge count got out of sync with the actual number of new messages");
923
 
    }
924
 
 
925
 
    if (this.visibleCount >= MAX_INDICATORS) {
926
 
      return;
927
 
    }
928
 
 
929
 
    this.refreshVisibility();
 
917
    if (this.visibleCount < MAX_INDICATORS) {
 
918
      this.refreshVisibility();
 
919
    }
930
920
  },
931
921
 
932
922
  /* Observes when items are added to folders, and when