[TASK] Use HTML5 input type number for backend pagination 31/50631/2
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:45:22 +0000 (13:45 +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/50631
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 3dd127a..6272e8b 100644 (file)
@@ -69,7 +69,7 @@
                                                        self.location.href= url;
                                                }
                                        </script>
-                                       <f:form.textfield id="paginator-{position}" name="paginator-target-page" class="form-control input-sm paginator-input" size="5" value="{pagination.current}" />
+                                       <f:form.textfield id="paginator-{position}" name="paginator-target-page" additionalAttributes="{min: '1'}" class="form-control input-sm paginator-input" size="5" value="{pagination.current}" type="number" />
                                        </form>
 
                                        / {pagination.numberOfPages}
                        </li>
                </ul>
        </nav>
-</f:section>
\ No newline at end of file
+</f:section>
index 46473b7..56458ca 100644 (file)
@@ -1343,7 +1343,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;" />
                        ';