set page number in js

pull/1974/head
Ayrat Badykov 6 years ago
parent 648b808bbb
commit e18f2ff541
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 10
      apps/block_scout_web/assets/js/lib/async_listing_load.js
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/common_components/_pagination_container.html.eex

@ -192,6 +192,16 @@ export const elements = {
$el.attr('href', state.prevPagePath)
}
},
'[data-async-listing] [data-page-number]': {
render ($el, state) {
if (state.pagesStack.length == 0) {
return $el.text('Page 1')
}
$el.text('Page ' + state.pagesStack.length)
}
},
'[data-async-listing] [data-loading-button]': {
render ($el, state) {
if (!state.loadingFirstPage && state.loading) return $el.show()

@ -35,7 +35,7 @@
</a>
</li>
<!-- Page X of XX -->
<li class="page-item"><a class="page-link no-hover" href><%= gettext "Page" %> <%= assigns[:cur_page_number] || "" %> <% if assigns[:total_pages_number] do %> <%= gettext "of" %> <%= assigns[:total_pages_number] || "undefined" %><% end %></a></li>
<li class="page-item"><a class="page-link no-hover" href data-page-number><%= gettext "Page" %> <%= assigns[:cur_page_number] || "" %> <% if assigns[:total_pages_number] do %> <%= gettext "of" %> <%= assigns[:total_pages_number] || "undefined" %><% end %></a></li>
<!-- Next -->
<li class="page-item">
<a

Loading…
Cancel
Save