[BUGFIX] Make pagination inputfield working in recordlist 48/35848/4
authorBenjamin Kott <benjamin.kott@outlook.com>
Tue, 6 Jan 2015 20:29:53 +0000 (21:29 +0100)
committerBenjamin Mack <benni@typo3.org>
Tue, 6 Jan 2015 23:04:05 +0000 (00:04 +0100)
- Correct inputfield refresh in recordlist
- Unify styling for fluid BE pagination widget and record list

Releases: master
Resolves: #64151
Change-Id: I341cad6bcbe7762ff4adc402dbc391732c706311
Reviewed-on: http://review.typo3.org/35848
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/extensionmanager/Resources/Public/JavaScript/Main.js
typo3/sysext/fluid/Resources/Private/Templates/ViewHelpers/Be/Widget/Paginate/Index.html
typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
typo3/sysext/t3skin/Resources/Private/Styles/TYPO3/_element_pagination.less
typo3/sysext/t3skin/Resources/Public/Css/visual/t3skin.css

index ab15d0d..2649c66 100644 (file)
@@ -426,7 +426,7 @@ define(['jquery', 'datatables', 'jquery/jquery.clearable'], function($) {
        ExtensionManager.Update = {
                identifier: {
                        terUpdateAction: '.update-from-ter',
        ExtensionManager.Update = {
                identifier: {
                        terUpdateAction: '.update-from-ter',
-                       pagination: '#typo3-dblist-pagination',
+                       pagination: '.pagination-wrap',
                        splashscreen: '.splash-receivedata',
                        terTableWrapper: '#terTableWrapper',
                        terTableDataTableWrapper: '#terTableWrapper .dataTables_wrapper'
                        splashscreen: '.splash-receivedata',
                        terTableWrapper: '#terTableWrapper',
                        terTableDataTableWrapper: '#terTableWrapper .dataTables_wrapper'
index 61a10bf..24a1d7c 100644 (file)
@@ -9,8 +9,8 @@
 </f:if>
 
 <f:section name="paginator">
 </f:if>
 
 <f:section name="paginator">
-       <nav id="typo3-dblist-pagination">
-               <ul class="pagination">
+       <nav class="pagination-wrap">
+               <ul class="pagination pagination-block">
                        <f:if condition="{pagination.hasLessPages}">
                                <f:then>
                                        <li>
                        <f:if condition="{pagination.hasLessPages}">
                                <f:then>
                                        <li>
                        <li>
                                <span>
                                        <f:translate key="widget.pagination.page" />
                        <li>
                                <span>
                                        <f:translate key="widget.pagination.page" />
-                                       <span>
-                                               <form id="paginator-form-{position}" onsubmit="goToPage{position}(this); return false;" style="display:inline;">
-                                               <script type="text/javascript">
-                                                       function goToPage{position}(formObject) {
-                                                               var url = '{f:widget.uri(arguments:{currentPage: 987654321})}';
-                                                               var page = formObject.elements['paginator-target-page'].value;
-                                                               if (page > {pagination.numberOfPages}) {
-                                                                       page = {pagination.numberOfPages};
-                                                               } else if (page < 1) {
-                                                                       page = 1;
-                                                               }
-                                                               url = url.replace('987654321', page);
-                                                               self.location.href= url;
+
+                                       <form id="paginator-form-{position}" onsubmit="goToPage{position}(this); return false;" style="display:inline;">
+                                       <script type="text/javascript">
+                                               function goToPage{position}(formObject) {
+                                                       var url = '{f:widget.uri(arguments:{currentPage: 987654321})}';
+                                                       var page = formObject.elements['paginator-target-page'].value;
+                                                       if (page > {pagination.numberOfPages}) {
+                                                               page = {pagination.numberOfPages};
+                                                       } else if (page < 1) {
+                                                               page = 1;
                                                        }
                                                        }
-                                               </script>
-                                               <f:form.textfield id="paginator-{position}" name="paginator-target-page" class="paginator-input" size="5" value="{pagination.current}" />
-                                               </form>
-                                       </span>
+                                                       url = url.replace('987654321', page);
+                                                       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}" />
+                                       </form>
+
                                        / {pagination.numberOfPages}
                                </span>
                        </li>
                                        / {pagination.numberOfPages}
                                </span>
                        </li>
index e909bb0..476c45b 100644 (file)
@@ -1082,7 +1082,7 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
                if ($renderPart === 'top') {
                        // Add js to traverse a page select input to a pointer value
                        $content = '
                if ($renderPart === 'top') {
                        // Add js to traverse a page select input to a pointer value
                        $content = '
-<script type="text/JavaScript">
+<script type="text/javascript">
 /*<![CDATA[*/
        function calculatePointer(page) {
                if (page > ' . $totalPages . ') {
 /*<![CDATA[*/
        function calculatePointer(page) {
                if (page > ' . $totalPages . ') {
@@ -1097,11 +1097,11 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
 </script>
 ';
                }
 </script>
 ';
                }
-               $pageNumberInput = '<span class="paginator-input">
-                       <input type="text" value="' . $currentPage . '" size="3" id="jumpPage-' . $renderPart . '" name="jumpPage-'
-                       . $renderPart . '" onkeyup="if (event.keyCode == Event.KEY_RETURN) { document.dblistForm.action=\'' . $listURL
+               $pageNumberInput = '
+                       <input type="text" 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=\'' . $listURL
                        . '&pointer=\'+calculatePointer(this.value); document.dblistForm.submit(); } return true;" />
                        . '&pointer=\'+calculatePointer(this.value); document.dblistForm.submit(); } return true;" />
-                       </span>';
+                       ';
                $pageIndicatorText = sprintf(
                        $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:pageIndicator'),
                        $pageNumberInput,
                $pageIndicatorText = sprintf(
                        $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xlf:pageIndicator'),
                        $pageNumberInput,
@@ -1117,16 +1117,16 @@ class DatabaseRecordList extends AbstractDatabaseRecordList {
 
                $titleColumn = $this->fieldArray[0];
                $data = array(
 
                $titleColumn = $this->fieldArray[0];
                $data = array(
-                       $titleColumn => '
-                               <nav>
-                                       <ul class="pagination">
+                       $titleColumn => $content . '
+                               <nav class="pagination-wrap">
+                                       <ul class="pagination pagination-block">
                                                ' . $first . '
                                                ' . $previous . '
                                                ' . $rangeIndicator . '
                                                ' . $pageIndicator . '
                                                ' . $next . '
                                                ' . $last . '
                                                ' . $first . '
                                                ' . $previous . '
                                                ' . $rangeIndicator . '
                                                ' . $pageIndicator . '
                                                ' . $next . '
                                                ' . $last . '
-                                               ' .     $reload . '
+                                               ' . $reload . '
                                        </ul>
                                </nav>
                        '
                                        </ul>
                                </nav>
                        '
index f9039c8..f33b8f6 100644 (file)
@@ -1,7 +1,6 @@
 //
 // Pagination
 //
 //
 // Pagination
 //
-
 .pagination {
     .t3-icon {
         margin: 0;
 .pagination {
     .t3-icon {
         margin: 0;
@@ -9,6 +8,11 @@
     }
     .paginator-input {
         display: inline-block;
     }
     .paginator-input {
         display: inline-block;
-        margin: -2px 0;
+               width: auto;
+        margin: -6px 0;
     }
 }
     }
 }
+.pagination-block {
+       display: block;
+       &:extend(.clearfix all);
+}
index 0c56ace..2dc2d9e 100644 (file)
@@ -4814,7 +4814,9 @@ button.close {
 .panel-body:before,
 .panel-body:after,
 .modal-footer:before,
 .panel-body:before,
 .panel-body:after,
 .modal-footer:before,
-.modal-footer:after {
+.modal-footer:after,
+.pagination-block:before,
+.pagination-block:after {
   content: " ";
   display: table;
 }
   content: " ";
   display: table;
 }
@@ -4831,7 +4833,8 @@ button.close {
 .navbar-header:after,
 .navbar-collapse:after,
 .panel-body:after,
 .navbar-header:after,
 .navbar-collapse:after,
 .panel-body:after,
-.modal-footer:after {
+.modal-footer:after,
+.pagination-block:after {
   clear: both;
 }
 .center-block {
   clear: both;
 }
 .center-block {
@@ -9811,7 +9814,11 @@ table#typo3-tree tr:hover {
 }
 .pagination .paginator-input {
   display: inline-block;
 }
 .pagination .paginator-input {
   display: inline-block;
-  margin: -2px 0;
+  width: auto;
+  margin: -6px 0;
+}
+.pagination-block {
+  display: block;
 }
 @font-face {
   font-family: 'Share';
 }
 @font-face {
   font-family: 'Share';