[BUGFIX] Recycler counts deleted records correctly 16/36716/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 6 Feb 2015 14:56:04 +0000 (15:56 +0100)
committerWouter Wolters <typo3@wouterwolters.nl>
Fri, 6 Feb 2015 17:39:47 +0000 (18:39 +0100)
This patch improves the usability and fixes a small bug:
- Add the clearable to the search form
- Count deleted records correctly

Resolves: #64911
Releases: master
Change-Id: I0fc702697ce1c630d39f6b127f605c9d8aa5afb4
Reviewed-on: http://review.typo3.org/36716
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
typo3/sysext/recycler/Classes/Controller/RecyclerAjaxController.php
typo3/sysext/recycler/Resources/Public/JavaScript/Recycler.js

index fb8aacf..aee0c42 100644 (file)
@@ -87,7 +87,7 @@ class RecyclerAjaxController {
                                $deletedRowsArray = $model->getDeletedRows();
 
                                $model = GeneralUtility::makeInstance(DeletedRecords::class);
-                               $totalDeleted = $model->getTotalCount($this->conf['startUid'], $this->conf['table'], $this->conf['depth'], $this->conf['filter']);
+                               $totalDeleted = $model->getTotalCount($this->conf['startUid'], $this->conf['table'], $this->conf['depth'], $this->conf['filterTxt']);
 
                                /* @var $controller DeletedRecordsController */
                                $controller = GeneralUtility::makeInstance(DeletedRecordsController::class);
index c2fb560..742ac6c 100644 (file)
@@ -14,7 +14,7 @@
 /**
  * RequireJS module for Recycler
  */
-define(['jquery', 'nprogress'], function($, NProgress) {
+define(['jquery', 'nprogress', 'jquery/jquery.clearable'], function($, NProgress) {
        var Recycler = {
                identifiers: {
                        searchForm: '#recycler-form',
@@ -79,7 +79,14 @@ define(['jquery', 'nprogress'], function($, NProgress) {
                                Recycler.elements.$searchSubmitBtn.addClass('disabled');
                                Recycler.loadDeletedElements();
                        }
-               });
+               }).clearable(
+                       {
+                               onClear: function() {
+                                       Recycler.elements.$searchSubmitBtn.addClass('disabled');
+                                       Recycler.loadDeletedElements();
+                               }
+                       }
+               );
 
                // changing "depth"
                Recycler.elements.$depthSelector.on('change', function() {