This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/controllers/user-notifications.js.es6

24 lines
626 B
JavaScript

export default Ember.ArrayController.extend({
needs: ['application'],
_showFooter: function() {
this.set("controllers.application.showFooter", !this.get("model.canLoadMore"));
}.observes("model.canLoadMore"),
showDismissButton: Ember.computed.gt('user.total_unread_notifications', 0),
currentPath: Em.computed.alias('controllers.application.currentPath'),
actions: {
resetNew: function() {
Discourse.ajax('/notifications/mark-read', { method: 'PUT' }).then(() => {
this.setEach('read', true);
});
},
loadMore: function() {
this.get('model').loadMore();
}
}
});