lib/pagy/extras/semantic.rb in pagy-4.6.0 vs lib/pagy/extras/semantic.rb in pagy-4.7.0

- old
+ new

@@ -33,12 +33,11 @@ 'link' => link.call(PAGE_PLACEHOLDER), 'active' => %(<a class="item active">#{pagy.page}</a>), 'gap' => %(<div class="disabled item">#{pagy_t('pagy.nav.gap')}</div>), 'after' => pagy_semantic_next_html(pagy, link) } - html = %(<div#{p_id} class="pagy-njs pagy-semantic-nav-js ui pagination menu" role="navigation"></div>) - html << pagy_json_tag(pagy, :nav, tags, pagy.sequels(steps)) + %(<div#{p_id} class="pagy-njs pagy-semantic-nav-js ui pagination menu" role="navigation" #{pagy_json_attr(pagy, :nav, tags, pagy.sequels(steps))}></div>) end # Combo pagination for semantic: it returns a nav and a JSON tag used by the Pagy.combo_nav javascript def pagy_semantic_combo_nav_js(pagy, deprecated_id=nil, pagy_id: nil, link_extra: '') pagy_id = Pagy.deprecated_arg(:id, deprecated_id, :pagy_id, pagy_id) if deprecated_id @@ -46,18 +45,18 @@ link = pagy_link_proc(pagy, link_extra: %(class="item" #{link_extra})) p_page = pagy.page p_pages = pagy.pages input = %(<input type="number" min="1" max="#{p_pages}" value="#{p_page}" style="padding: 0; text-align: center; width: #{p_pages.to_s.length+1}rem; margin: 0 0.3rem">) - %(<div#{p_id} class="pagy-semantic-combo-nav-js ui compact menu" role="navigation">#{ + %(<div#{p_id} class="pagy-semantic-combo-nav-js ui compact menu" role="navigation" #{ + pagy_json_attr pagy, :combo_nav, p_page, pagy_marked_link(link) + }>#{ pagy_semantic_prev_html pagy, link }<div class="pagy-combo-input item">#{ pagy_t 'pagy.combo_nav_js', page_input: input, count: p_page, pages: p_pages }</div> #{ pagy_semantic_next_html pagy, link - }</div>#{ - pagy_json_tag pagy, :combo_nav, p_page, pagy_marked_link(link) - }) + }</div>) end private def pagy_semantic_prev_html(pagy, link)