Mark all read button should always start invisible

Whether the button should appear or not is updated when the badge
is updated, based on having unread notifications. But during construction
the button should be hidden.

When we do update the badge, the button should only appear if there
are unread messages and if the current widget is not 'markReadWhenSeen'
to avoid having the button 'flash' while notifications are marked
read.

Bug: T113629
Change-Id: I002db9e3d8990b5a2cd67bf5d120b1c7eb454362
This commit is contained in:
Moriel Schottlender 2015-09-28 13:21:37 -07:00 committed by Catrope
parent 390dc4afa2
commit e0cd881aeb

View file

@ -127,7 +127,7 @@
this.popup.closeButton.toggle( false ); this.popup.closeButton.toggle( false );
// Add the 'mark all as read' button to the header // Add the 'mark all as read' button to the header
this.popup.$head.append( this.markAllReadButton.$element ); this.popup.$head.append( this.markAllReadButton.$element );
this.markAllReadButton.toggle( !this.markReadWhenSeen && !!config.hasUnseen ); this.markAllReadButton.toggle( false );
// Events // Events
this.markAllReadButton.connect( this, { click: 'onMarkAllReadButtonClick' } ); this.markAllReadButton.connect( this, { click: 'onMarkAllReadButtonClick' } );
@ -222,7 +222,7 @@
} }
// Check if we need to display the 'mark all unread' button // Check if we need to display the 'mark all unread' button
this.markAllReadButton.toggle( !!unreadCount ); this.markAllReadButton.toggle( !this.markReadWhenSeen && !!unreadCount );
this.currentUnreadCountInBadge = unreadCount; this.currentUnreadCountInBadge = unreadCount;
}; };