function for clearing selected files
authorMaciej Tronowski <mtro@man.poznan.pl>
Tue, 24 Mar 2015 16:33:30 +0000 (17:33 +0100)
committerMaciej Tronowski <mtro@man.poznan.pl>
Tue, 24 Mar 2015 16:33:30 +0000 (17:33 +0100)
filex/static/filex/filex.js

index 81b401c..53f7fc6 100644 (file)
@@ -405,6 +405,14 @@ $(function(){
 
         updateSelectAll: function() {
             this.$selectAll.prop('checked', this.selectedFiles().length == this.visibleFiles().length);
+        },
+
+        clearSelection: function() {
+            _.each(this.visibleFiles(), function(item) {
+                item.set('checked', false);
+            });
+
+            this.updateSelectAll();
         }
     });
 });