mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 05:33:47 +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;
|
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'),
|
currentPath: Em.computed.alias('controllers.application.currentPath'),
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
|
|
|
@ -23,7 +23,8 @@
|
||||||
class='btn dismiss-notifications'
|
class='btn dismiss-notifications'
|
||||||
action="resetNew"
|
action="resetNew"
|
||||||
label='user.dismiss_notifications'
|
label='user.dismiss_notifications'
|
||||||
icon='check'}}
|
icon='check'
|
||||||
|
disabled=allNotificationsRead}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user