mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 05:03:39 +08:00
UX: Disable dismiss notifications button when there is nothing to dismiss.
This commit is contained in:
parent
331135a88e
commit
927bf19d93
|
@ -14,6 +14,11 @@ export default Ember.ArrayController.extend({
|
|||
return length > 0;
|
||||
},
|
||||
|
||||
@computed('model.content.@each.read')
|
||||
allNotificationsRead() {
|
||||
return !this.get('model.content').some((notification) => !notification.get('read'));
|
||||
},
|
||||
|
||||
currentPath: Em.computed.alias('controllers.application.currentPath'),
|
||||
|
||||
actions: {
|
||||
|
|
|
@ -23,7 +23,8 @@
|
|||
class='btn dismiss-notifications'
|
||||
action="resetNew"
|
||||
label='user.dismiss_notifications'
|
||||
icon='check'}}
|
||||
icon='check'
|
||||
disabled=allNotificationsRead}}
|
||||
{{/if}}
|
||||
</section>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user