Fix clipboard without markAll element
authorMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2015 13:58:53 +0000 (14:58 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Mon, 21 Dec 2015 13:58:53 +0000 (14:58 +0100)
wcfsetup/install/files/js/WoltLab/WCF/Controller/Clipboard.js

index 3e9782b55d81d3ab06ce68af81e904ede86329ad..24117fef65d5141db474b39496011c9a24a172e2 100644 (file)
@@ -216,17 +216,19 @@ define(
                        data.markedObjectIds[(isMarked ? 'add' : 'delete')](objectId);
                        clipboardObject.classList[(isMarked) ? 'add' : 'remove']('jsMarked');
                        
-                       var markedAll = true;
-                       for (var i = 0, length = data.checkboxes.length; i < length; i++) {
-                               if (!data.checkboxes[i].checked) {
-                                       markedAll = false;
-                                       
-                                       break;
+                       if (data.markAll !== null) {
+                               var markedAll = true;
+                               for (var i = 0, length = data.checkboxes.length; i < length; i++) {
+                                       if (!data.checkboxes[i].checked) {
+                                               markedAll = false;
+                                               
+                                               break;
+                                       }
                                }
+                               
+                               data.markAll.checked = markedAll;
                        }
                        
-                       data.markAll.checked = markedAll;
-                       
                        this._saveState(type, [ objectId ], isMarked);
                },
                
@@ -545,7 +547,9 @@ define(
                                clipboardObject.classList[(isMarked ? 'add' : 'remove')]('jsMarked');
                        }
                        
-                       data.markAll.checked = markAll;
+                       if (data.markAll !== null) {
+                               data.markAll.checked = markAll;
+                       }
                }
        };