diff options
author | Bruno Wagner <bwagner@thoughtworks.com> | 2014-10-16 17:47:03 +0200 |
---|---|---|
committer | Bruno Wagner <bwagner@thoughtworks.com> | 2014-10-16 17:48:56 +0200 |
commit | 19f89c970b214d2b131cbc4124b1630b0f330efa (patch) | |
tree | a68dce1a6584fde8f272a2ace60e9ec6cf2bdaf3 /web-ui/app/js | |
parent | a8f3d31bd41def7a334b5a2f4f260ec77ce76d2c (diff) |
Fixed the pagination on the front-end and added real total mail count ot the search result
Diffstat (limited to 'web-ui/app/js')
-rw-r--r-- | web-ui/app/js/services/mail_service.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/web-ui/app/js/services/mail_service.js b/web-ui/app/js/services/mail_service.js index af957a7b..4337da0e 100644 --- a/web-ui/app/js/services/mail_service.js +++ b/web-ui/app/js/services/mail_service.js @@ -230,7 +230,7 @@ define( }; this.nextPage = function () { - if (this.attr.currentPage < (this.attr.numPages - 1)) { + if (this.attr.currentPage < (this.attr.numPages)) { this.updateCurrentPageNumber(this.attr.currentPage + 1); this.refreshResults(); } @@ -263,18 +263,21 @@ define( this.after('initialize', function () { that = this; - this.on(events.mail.tags.update, this.updateTags); - this.on(events.mail.draftReply.want, this.wantDraftReplyForMail); - this.on(events.mail.want, this.fetchSingle); - this.on(events.mail.read, this.readMail); - this.on(events.mail.unread, this.unreadMail); - this.on(events.mail.delete, this.deleteMail); - this.on(events.mail.deleteMany, this.deleteManyMails); - this.on(events.search.perform, this.newSearch); - this.on(events.ui.mails.fetchByTag, this.fetchByTag); - this.on(events.ui.mails.refresh, this.refreshResults); - this.on(events.ui.page.previous, this.previousPage); - this.on(events.ui.page.next, this.nextPage); + if (features.isEnabled('tags')) { + this.on(events.mail.tags.update, this.updateTags); + } + + this.on(document, events.mail.draftReply.want, this.wantDraftReplyForMail); + this.on(document, events.mail.want, this.fetchSingle); + this.on(document, events.mail.read, this.readMail); + this.on(document, events.mail.unread, this.unreadMail); + this.on(document, events.mail.delete, this.deleteMail); + this.on(document, events.mail.deleteMany, this.deleteManyMails); + this.on(document, events.search.perform, this.newSearch); + this.on(document, events.ui.mails.fetchByTag, this.fetchByTag); + this.on(document, events.ui.mails.refresh, this.refreshResults); + this.on(document, events.ui.page.previous, this.previousPage); + this.on(document, events.ui.page.next, this.nextPage); }); } } |