diff --git a/app/javascript/packs/controllers/dataset_controller.js b/app/javascript/packs/controllers/dataset_controller.js index 92e65ecfb608aac6f08a20ca55efd22ee100c4a5..c183ae62609583b502376757a4ff61a2d624c0d4 100644 --- a/app/javascript/packs/controllers/dataset_controller.js +++ b/app/javascript/packs/controllers/dataset_controller.js @@ -101,8 +101,8 @@ export default class extends Controller { page_select(event) { event.preventDefault() - const input_page = this.inputPageTarget.value - if (!Number.isNaN(input_page) && 1 <= input_page && input_page <= this.nbPagesValue && !(this.currentPageValue == input_page)) { + const input_page = parseInt(this.inputPageTarget.value) + if (!isNaN(input_page) && 1 <= input_page && input_page <= this.nbPagesValue && !(this.currentPageValue == input_page)) { this.currentPageValue = input_page this.loadDocuments(this.idValue, this.currentPageValue, this.perPageValue, this.sortValue, this.sortOrderValue, $("#doctype_selection input:checked").data("doctype")) } diff --git a/app/views/dataset/_pagination.html.erb b/app/views/dataset/_pagination.html.erb index 41546fcc4e8d0990abfb3b4f49d630d63eabc5d6..7e2c650095db8fe689a6702eaeb98ddf7d1dc630 100644 --- a/app/views/dataset/_pagination.html.erb +++ b/app/views/dataset/_pagination.html.erb @@ -10,7 +10,7 @@ <% if i == current_page %> <li class="page-item active"> <form class="page-link" data-action="dataset#page_select"> - <input type="text" data-dataset-target="inputPage" value="<%= i %>" style="width:25px; height:20px"> + <input type="text" data-dataset-target="inputPage" value="<%= i %>" style="width:25px; height:20px; text-align:center"> <input type="submit" class="sr-only" tabindex="-1"> </form> </li> @@ -30,7 +30,7 @@ <% if i == current_page %> <li class="page-item active"> <form class="page-link" data-action="dataset#page_select"> - <input type="text" data-dataset-target="inputPage" value="<%= i %>" style="width:30px; height:25px"> + <input type="text" data-dataset-target="inputPage" value="<%= i %>" style="width:25px; height:20px; text-align:center"> <input type="submit" class="sr-only" tabindex="-1"> </form> </li>