aboutsummaryrefslogtreecommitdiffstats
path: root/files/js/files.js
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2011-04-17 15:59:06 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2011-04-17 15:59:06 +0200
commitee4d087e72ab9a91baf0681a5d4ee6582ba4fd37 (patch)
tree44ec735e0229cda9fc169f4306441d4a6fe99e14 /files/js/files.js
parent4b0a3163c8e7b89f51c130736cdb5fa98a934ded (diff)
downloadnextcloud-server-ee4d087e72ab9a91baf0681a5d4ee6582ba4fd37.tar.gz
nextcloud-server-ee4d087e72ab9a91baf0681a5d4ee6582ba4fd37.zip
don't reload the whole page after file upload
Diffstat (limited to 'files/js/files.js')
-rw-r--r--files/js/files.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/files/js/files.js b/files/js/files.js
index 9eeeb7f6bfd..44506763032 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -55,6 +55,28 @@ function uploadFinished() {
if(result.status == "error") {
alert('An error occcured, upload failed.\nError code: ' + result.data.error);
} else {
- location.href = 'index.php?dir=' + $('#dir').val();
+ dir = $('#dir').val();
+ $.ajax({
+ url: 'ajax/list.php',
+ data: "dir="+dir,
+ complete: refreshContents
+ });
}
}
+
+function refreshContents(data) {
+ result = eval("("+data.responseText+");");
+ if(typeof(result.data.breadcrumb) != 'undefined'){
+ updateBreadcrumb(result.data.breadcrumb);
+ }
+ updateFileList(result.data.files);
+ $('#file_upload_button').click();
+}
+
+function updateBreadcrumb(breadcrumbHtml) {
+ $('p.nav').empty().html(breadcrumbHtml);
+}
+
+function updateFileList(fileListHtml) {
+ $('#fileList').empty().html(fileListHtml);
+}