diff options
-rw-r--r-- | apps/files/js/filelist.js | 6 | ||||
-rw-r--r-- | apps/files/js/files.js | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index d0c0fc1a7fc..5e17f128a7d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1802,6 +1802,10 @@ OCA.Files.Files.updateStorageStatistics(this.getCurrentDirectory(), force); }, + updateStorageQuotas: function() { + OCA.Files.Files.updateStorageQuotas(this.getCurrentDirectory()); + }, + /** * @deprecated do not use nor override */ @@ -3075,6 +3079,8 @@ self.showFileBusyState(uploadText.closest('tr'), false); uploadText.fadeOut(); uploadText.attr('currentUploads', 0); + + self.updateStorageQuotas(); }); uploader.on('createdfolder', function(fullPath) { self.addAndFetchFileInfo(OC.basename(fullPath), OC.dirname(fullPath)); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index a1e59015b1d..5e34f664a6c 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -32,6 +32,23 @@ Files.updateQuota(response); }); }, + // update quota + updateStorageQuotas: function(currentDir) { + var state = Files.updateStorageStatistics; + if (state.dir){ + if (state.dir === currentDir) { + return; + } + // cancel previous call, as it was for another dir + state.call.abort(); + } + state.dir = currentDir; + state.call = $.getJSON(OC.filePath('files','ajax','getstoragestats.php') + '?dir=' + encodeURIComponent(currentDir),function(response) { + state.dir = null; + state.call = null; + Files.updateQuota(response); + }); + }, /** * Update storage statistics such as free space, max upload, * etc based on the given directory. |