Reset current page when changing page size
This commit is contained in:
parent
3d02f61455
commit
8dc54a6164
|
@ -2,9 +2,10 @@ import Component from '@ember/component';
|
|||
import { inject as service } from '@ember/service';
|
||||
|
||||
export default Component.extend({
|
||||
tagName: '',
|
||||
|
||||
userSettings: service(),
|
||||
|
||||
tagName: '',
|
||||
pageSizeOptions: Object.freeze([10, 25, 50]),
|
||||
|
||||
onChange() {},
|
||||
});
|
||||
|
|
|
@ -5,7 +5,10 @@
|
|||
class="field-body"
|
||||
@options={{pageSizeOptions}}
|
||||
@selected={{userSettings.pageSize}}
|
||||
@onChange={{action (mut userSettings.pageSize)}} as |option|>
|
||||
@onChange={{action (queue
|
||||
(action (mut userSettings.pageSize))
|
||||
(action onChange)
|
||||
)}} as |option|>
|
||||
{{option}}
|
||||
</PowerSelect>
|
||||
</div>
|
||||
|
|
|
@ -93,7 +93,7 @@
|
|||
{{/t.body}}
|
||||
{{/list-table}}
|
||||
<div class="table-foot">
|
||||
{{page-size-select}}
|
||||
{{page-size-select onChange=(action resetPagination)}}
|
||||
<nav class="pagination">
|
||||
<div class="pagination-numbers">
|
||||
{{p.startsAt}}–{{p.endsAt}} of {{sortedJobs.length}}
|
||||
|
|
Loading…
Reference in New Issue