diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-02-01 15:33:12 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-02-01 15:33:12 +0100 |
commit | 0124809a42dd72d9c6d9b550687fa0013a88b6da (patch) | |
tree | e5011f8b961251ee550e64355f58343cad1b9f65 | |
parent | a69d3c3346b7b254e3e0ab6766f40842a4ad3878 (diff) | |
download | nextcloud-server-0124809a42dd72d9c6d9b550687fa0013a88b6da.tar.gz nextcloud-server-0124809a42dd72d9c6d9b550687fa0013a88b6da.zip |
prevent sharing from making aditional http requests while scanning
additional requests to the server can block feedback of scannning depending on server configuration
-rw-r--r-- | apps/files_sharing/js/share.js | 1 | ||||
-rw-r--r-- | files/js/files.js | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index 4457dddbe15..d01a07447a6 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -2,6 +2,7 @@ $(document).ready(function() { var shared_status = {}; if (typeof FileActions !== 'undefined') { FileActions.register('all', 'Share', function(filename) { + if (scanFiles.scanning){return;}//workaround to prevent aditional http request block scanning feedback var icon; var file = $('#dir').val()+'/'+filename; if(shared_status[file]) diff --git a/files/js/files.js b/files/js/files.js index 0eca0959def..bebcf4e97a4 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -347,6 +347,7 @@ $(document).ready(function() { function scanFiles(force){ force=!!force; //cast to bool + scanFiles.scanning=true; $('#scanning-message').show(); $('#fileList').remove(); var scannerEventSource=new OC.EventSource(OC.filePath('files','ajax','scan.php'),{force:force}); @@ -356,6 +357,7 @@ function scanFiles(force){ $('#scan-current').text(data.file+'/'); }); scannerEventSource.listen('success',function(success){ + scanFiles.scanning=false; if(success){ window.location.reload(); }else{ @@ -363,6 +365,7 @@ function scanFiles(force){ } }); } +scanFiles.scanning=false; function boolOperationFinished(data, callback) { result = jQuery.parseJSON(data.responseText); |