Sha256: 35eaba7ac400c0d55215457d52f959105f71cf364a8ca93aa3056f49f33b79ac
Contents?: true
Size: 963 Bytes
Versions: 18
Compression:
Stored size: 963 Bytes
Contents
%script{type: 'text/javascript', src:'/javascripts/pagination.js'} :javascript const PAGE_NUMBER = #{page_number}; const PAGE_SIZE = #{page_size}; const TOTAL_NUMBER = #{pagination_record_count} const CURRENT_PAGE_SIZE = #{current_page_size} $(document).ready(function(){ function createPageLink(pageNumber, pageSize) { const url = new URL(window.location) url.searchParams.set('page', pageNumber) url.searchParams.set('pageSize', pageSize) return url.toString() } function createFooter(currentPage, totalPage, totalNumber) { return `<div class='nav-footer'>${CURRENT_PAGE_SIZE} of ${totalNumber} pacts</div>` } $('div.pagination').pagination({ dataSource: [], totalNumber: TOTAL_NUMBER, pageNumber: PAGE_NUMBER, pageSize: PAGE_SIZE, pageRange: 2, pageLink: createPageLink, ulClassName: 'pagination', footer: createFooter }) });
Version data entries
18 entries across 18 versions & 1 rubygems