[BUGFIX] Recycler: disable mass delete/recover if no record is selected 21/57721/3
authorJosef Glatz <josefglatz@gmail.com>
Sun, 29 Jul 2018 20:22:56 +0000 (22:22 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 31 Jul 2018 11:25:27 +0000 (13:25 +0200)
This patch really disables the mass delete/recover button
functionality of the recycler.

Resolves: #85680
Releases: master, 8.7
Change-Id: I5a6ba4f555cc06b017f3d9ff8deef7d7deac03db
Reviewed-on: https://review.typo3.org/57721
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Tested-by: Jan Stockfisch <jan.stockfisch@googlemail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/recycler/Resources/Private/Templates/RecyclerModule/Index.html
typo3/sysext/recycler/Resources/Public/JavaScript/Recycler.js

index eb9eb33..1f58672 100644 (file)
                        </table>
                </div>
                <div>
-                       <button class="btn btn-default disabled" data-action="massundo">
+                       <button class="btn btn-default disabled" data-action="massundo" disabled>
                                <core:icon identifier="actions-edit-undo" />
                                <span class="text">
                                        <f:translate key="button.undo" />
                                </span>
                        </button>
                        <f:if condition="{allowDelete}">
-                               <button class="btn btn-default disabled" data-action="massdelete">
+                               <button class="btn btn-default disabled" data-action="massdelete" disabled>
                                        <core:icon identifier="actions-edit-delete" />
                                        <span class="text">
                                                <f:translate key="button.delete" />
index 2c9f890..c6f9af4 100644 (file)
@@ -240,10 +240,10 @@ define(['jquery',
 
     if (Recycler.markedRecordsForMassAction.length > 0) {
       if (Recycler.elements.$massUndo.hasClass('disabled')) {
-        Recycler.elements.$massUndo.removeClass('disabled');
+        Recycler.elements.$massUndo.removeClass('disabled').removeAttr('disabled');
       }
       if (Recycler.elements.$massDelete.hasClass('disabled')) {
-        Recycler.elements.$massDelete.removeClass('disabled');
+        Recycler.elements.$massDelete.removeClass('disabled').removeAttr('disabled');
       }
 
       var btnTextUndo = Recycler.createMessage(TYPO3.lang['button.undoselected'], [Recycler.markedRecordsForMassAction.length]),
@@ -262,9 +262,9 @@ define(['jquery',
    */
   Recycler.resetMassActionButtons = function() {
     Recycler.markedRecordsForMassAction = [];
-    Recycler.elements.$massUndo.addClass('disabled');
+    Recycler.elements.$massUndo.addClass('disabled').attr('disabled', true);
     Recycler.elements.$massUndo.find('span.text').text(TYPO3.lang['button.undo']);
-    Recycler.elements.$massDelete.addClass('disabled');
+    Recycler.elements.$massDelete.addClass('disabled').attr('disabled', true);
     Recycler.elements.$massDelete.find('span.text').text(TYPO3.lang['button.delete']);
   };