[TASK] Use HTML5 input type number for backend pagination 45/50545/4
authorGeorg Ringer <georg.ringer@gmail.com>
Tue, 8 Nov 2016 14:54:46 +0000 (15:54 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Sun, 13 Nov 2016 12:34:52 +0000 (13:34 +0100)
Using the type number for the pagination page field improves the
usability.

Resolves: #78608
Releases: master, 7.6
Change-Id: I963bda892bb7a0ec72b2726f6086808dd421ac1c
Reviewed-on: https://review.typo3.org/50545
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Be/Widget/Paginate/Index.html
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php

index 744b9d0..f297f1d 100644 (file)
@@ -75,7 +75,7 @@
                                        <f:translate key="widget.pagination.page" />
 
                                        <form onsubmit="return goToPage(this);" style="display:inline;">
-                                               <f:form.textfield additionalAttributes="{data-number-of-pages: '{pagination.numberOfPages}', data-url: '{f:widget.uri(arguments:{currentPage: 987654321})}'}" name="paginator-target-page" class="form-control input-sm paginator-input" size="5" value="{pagination.current}" />
+                                               <f:form.textfield additionalAttributes="{min: '1', data-number-of-pages: '{pagination.numberOfPages}', data-url: '{f:widget.uri(arguments:{currentPage: 987654321})}'}" name="paginator-target-page" class="form-control input-sm paginator-input" size="5" value="{pagination.current}" type="number" />
                                        </form>
 
                                        / {pagination.numberOfPages}
index 752441a..2d16dfd 100644 (file)
@@ -1351,7 +1351,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList
 ';
         }
         $pageNumberInput = '
-                       <input type="text" value="' . $currentPage . '" size="3" class="form-control input-sm paginator-input" id="jumpPage-' . $renderPart . '" name="jumpPage-'
+                       <input type="number" min="1" max="' . $totalPages . '" value="' . $currentPage . '" size="3" class="form-control input-sm paginator-input" id="jumpPage-' . $renderPart . '" name="jumpPage-'
             . $renderPart . '" onkeyup="if (event.keyCode == 13) { document.dblistForm.action=' . GeneralUtility::quoteJSvalue($listURL
             . '&pointer=') . '+calculatePointer(this.value); document.dblistForm.submit(); } return true;" />
                        ';