Skip to content
Snippets Groups Projects
Commit 7fcc1223 authored by smayer's avatar smayer
Browse files

Fix page input conversion to integer

parent fda51cee
Branches
No related tags found
1 merge request!2Merging development into onb as preparation for Annolyzer release
......@@ -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"))
}
......
......@@ -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>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment