lib/pagy/extras/materialize.rb in pagy-5.7.1 vs lib/pagy/extras/materialize.rb in pagy-5.7.2
- old
+ new
@@ -24,11 +24,11 @@
end
html << pagy_materialize_next_html(pagy, link)
html << %(</ul></div>)
end
- # Javascript pagination for materialize: it returns a nav and a JSON tag used by the Pagy.nav javascript
+ # Javascript pagination for materialize: it returns a nav and a JSON tag used by the pagy.js file
def pagy_materialize_nav_js(pagy, pagy_id: nil, link_extra: '', **vars)
sequels = pagy.sequels(**vars)
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: link_extra)
@@ -40,11 +40,11 @@
%(<div#{p_id} class="#{'pagy-rjs ' if sequels.size > 1}pagy-materialize-nav-js" role="navigation" aria-label="pager" #{
pagy_json_attr(pagy, :nav, tags, sequels, pagy.label_sequels(sequels))}></div>)
end
- # Javascript combo pagination for materialize: it returns a nav and a JSON tag used by the Pagy.combo_nav javascript
+ # Javascript combo pagination for materialize: it returns a nav and a JSON tag used by the pagy.js file
def pagy_materialize_combo_nav_js(pagy, pagy_id: nil, link_extra: '')
p_id = %( id="#{pagy_id}") if pagy_id
link = pagy_link_proc(pagy, link_extra: link_extra)
p_page = pagy.page
p_pages = pagy.pages
@@ -52,10 +52,10 @@
input = %(<input type="number" class="browser-default" min="1" max="#{p_pages}" value="#{
p_page}" style="text-align: center; width: #{p_pages.to_s.length + 1}rem;">)
html = %(<ul#{p_id} class="pagy-materialize-combo-nav-js pagination chip" role="navigation")
%(#{html} aria-label="pager" style="padding-right: 0" #{
- pagy_json_attr pagy, :combo_nav, pagy_marked_link(link)}>#{
+ pagy_json_attr pagy, :combo, pagy_marked_link(link)}>#{
pagy_materialize_prev_html pagy, link, style}<li class="pagy-combo-input">#{
pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages}</li>#{
pagy_materialize_next_html pagy, link, style}</ul>)
end