function for clearing selected files
[qcg-portal.git] / 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();
         }
     });
 });