Skip to content

Commit

Permalink
Update counter value for message filtering, fixes T451
Browse files Browse the repository at this point in the history
Summary: -Call `{{pagination.totalRecords}}` to update counter label in messages list template file

Test Plan:
 - Go to messages
 - Click on `All` `Inbox` `Outbox` and `Archived`
 - See the counter label update

Reviewers: rjmackay, eyedol

Subscribers: seth, srutto, lkamau

Maniphest Tasks: T451

Differential Revision: https://phabricator.ushahidi.com/D226
  • Loading branch information
Woody Gilk committed Jul 10, 2014
1 parent 41aef79 commit 5af5ec5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ <h3>Messages</h3>
<ul class="filter-tags-list filter-tags-list--message js-filter-tags-list hide-for-small">
<li class="active js-message-filter-box" data-box-name="">
<a href class="message-type">All
<span class="all-count-number hide-for-small"><span class="count-number">{{pagination.totalRecords}}</span></span>
<span class="all-count-number hide-for-small"><span class="count-number js-tab-number-label">{{pagination.totalRecords}}</span></span>
</a>
</li>
{{#each boxTypes}}
<li class="js-message-filter-box" data-box-name="{{@key}}">
<a href class="message-type">{{this}}
<span class="{{@key}}-count-number hide-for-small visually-hidden"><span class="count-number">0</span></span>
<span class="{{@key}}-count-number hide-for-small visually-hidden"><span class="count-number js-tab-number-label">{{../pagination.totalRecords}}</span></span>
</a>
</li>
{{/each}}
Expand All @@ -76,7 +76,7 @@ <h3>Messages</h3>
{{#each boxTypes}}
<li class="dropdown-list__item js-message-filter-box" data-box-name="{{@key}}">
<a href class="message-type">{{this}}
<span class="{{@key}}-count-number hide-for-small visually-hidden"><span class="count-number">0</span></span>
<span class="{{@key}}-count-number hide-for-small visually-hidden"><span class="count-number js-tab-number-label">{{pagination.totalRecords}}</span></span>
</a>
</li>
{{/each}}
Expand Down
3 changes: 3 additions & 0 deletions modules/UshahidiUI/media/js/app/mixin/PageableViewBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ define(['marionette', 'handlebars'], function (Marionette, Handlebars) {
modelName: this.options.modelName
})
);

// Update counter
this.view.$('li.active span.js-tab-number-label').text(this.view.collection.state.totalRecords);
},
updatePageSize : function (e)
{
Expand Down

0 comments on commit 5af5ec5

Please sign in to comment.