From 9f62059efa869ff677130f06bf1b46be49950515 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 11 Feb 2014 16:52:56 +0100 Subject: Fix file summary to use the whole file list - moved the summary code into a new class FileSummary - FileSummary is calculated only once, then updated with add/remove - added new OC.Util namespace for JS utility functions --- apps/files_trashbin/js/trash.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/files_trashbin/js') diff --git a/apps/files_trashbin/js/trash.js b/apps/files_trashbin/js/trash.js index f7724d07d2b..4ed5ba1c76e 100644 --- a/apps/files_trashbin/js/trash.js +++ b/apps/files_trashbin/js/trash.js @@ -34,10 +34,12 @@ $(document).ready(function() { } var files = result.data.success; + var $el; for (var i = 0; i < files.length; i++) { - FileList.remove(OC.basename(files[i].filename), {updateSummary: false}); + $el = FileList.remove(OC.basename(files[i].filename), {updateSummary: false}); + FileList.fileSummary.remove({type: $el.attr('data-type'), size: $el.attr('data-size')}); } - FileList.updateFileSummary(); + FileList.fileSummary.update(); FileList.updateEmptyContent(); enableActions(); } -- cgit v1.2.3