aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-12-08 15:26:31 +0100
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-12-11 16:32:27 +0100
commitc615b3527f7c472afbc93d3293c7f467a99cbd0b (patch)
treed0ad68fee618b2c30e6da61d208ba283a487af6a /apps/files/js
parent85176ec0721f5a1ac2dd8f08dd34f7d8d51b6a19 (diff)
downloadnextcloud-server-c615b3527f7c472afbc93d3293c7f467a99cbd0b.tar.gz
nextcloud-server-c615b3527f7c472afbc93d3293c7f467a99cbd0b.zip
show readonly message in file conflict dialog, make it always selected
Diffstat (limited to 'apps/files/js')
-rw-r--r--apps/files/js/file-upload.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index ab450dc5cac..9fe623075bc 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -175,7 +175,14 @@ OC.Upload = {
* @param {function} callbacks.onCancel
*/
checkExistingFiles: function (selection, callbacks) {
- // TODO check filelist before uploading and show dialog on conflicts, use callbacks
+ /*
+ $.each(selection.uploads, function(i, upload) {
+ var $row = OCA.Files.App.fileList.findFileEl(upload.files[0].name);
+ if ($row) {
+ // TODO check filelist before uploading and show dialog on conflicts, use callbacks
+ }
+ });
+ */
callbacks.onNoConflicts(selection);
},
@@ -417,11 +424,15 @@ OC.Upload = {
data.textStatus = 'servererror';
data.errorThrown = t('files', 'Could not get result from server.');
fu._trigger('fail', e, data);
+ } else if (result[0].status === 'readonly') {
+ var original = result[0];
+ var replacement = data.files[0];
+ OC.dialogs.fileexists(data, original, replacement, OC.Upload);
} else if (result[0].status === 'existserror') {
//show "file already exists" dialog
var original = result[0];
var replacement = data.files[0];
- OC.dialogs.fileexists(data, original, replacement, OC.Upload, fu);
+ OC.dialogs.fileexists(data, original, replacement, OC.Upload);
} else if (result[0].status !== 'success') {
//delete data.jqXHR;
data.textStatus = 'servererror';