fix select all checkbox
authorMaciej Tronowski <mtro@man.poznan.pl>
Mon, 13 Apr 2015 14:10:46 +0000 (16:10 +0200)
committerMaciej Tronowski <mtro@man.poznan.pl>
Mon, 13 Apr 2015 14:10:46 +0000 (16:10 +0200)
filex/static/filex/filex.js

index 10dc6bc..5132ec7 100644 (file)
@@ -387,7 +387,14 @@ $(function(){
         },
 
         updateSelectAll: function() {
-            this.$selectAll.prop('checked', this.selectedFiles().length == this.visibleFiles().length);
+            if (this.visibleFiles().length) {
+                this.$selectAll.prop('disabled', false);
+                this.$selectAll.prop('checked', this.selectedFiles().length == this.visibleFiles().length);
+            }
+            else {
+                this.$selectAll.prop('disabled', true);
+                this.$selectAll.prop('checked', false);
+            }
         },
 
         clearSelection: function() {