-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling wrong in page changes #2 #506
Comments
Please, try to use my pull request to racer. It is working for me for reactive pagination, wanna to know your feelings My paginator component: class CardsList_Paginator
create: (model) ->
model.start 'pages', model.scope('_page.cards_count'), model.scope('_session.cards_in_page'), (cards_count, cards_in_page) ->
last = Math.ceil cards_count / cards_in_page
last = 1 if last == 0
[0..last - 1]
previousPage: (ev) ->
page = app.model.get '_session.page_index'
page -= 1
page = 0 if page < 0
@gotoPage ev, page
nextPage: (ev) ->
page = app.model.get '_session.page_index'
page = 1 unless page
page += 1
last = @model.get 'pages'
last = last[last.length - 1]
page = last if page > last
@gotoPage ev, page
gotoPage: (ev, page) ->
app.model.set '_session.page_index', page
body = $ "html, body"
body.animate { scrollTop:0 }, '500', 'swing'
do ev.preventDefault and view (bootstrap 3) paginator:
ul.pagination(class='{{if !pages || pages.length == 1}}hidden{{/}}')
li
a(href="#" aria-label="Previous" on-click='previousPage($event)')
span(aria-hidden="true") «
each pages as #page
li
a(href="#" on-click='gotoPage($event, #page)') {{#page + 1}}
li
a(href="#" aria-label="Next" on-click='nextPage($event)')
span(aria-hidden="true") » May be it is not a best solution, but it is working. Want to know your opinion |
Thanks for your contributing your issue. We have recently been actively updating the Derby and Racer packages, and both repos are now in Typescript and published with types on npm. As we have quite a few old issues open we have made the decision to close out of date issues. If this issue still matters to you we encourage reproducing against the current versions of the repo and opening a new issue. |
This issue is still relevant.
The text was updated successfully, but these errors were encountered: