X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=frontend%2Fjs%2Fapp.js;h=b68b6089cf5963831350d3ad0aa24179c2a1e7d7;hb=19efa5bcdb745205ef5a6812480890968a17d1a9;hp=92dc1defd6b804183a2140583fe6a0ac77140e0c;hpb=25c2c5dea457b206c26a9f746210016773a919b3;p=perso%2FImmae%2FProjets%2FNodejs%2FSurfer.git diff --git a/frontend/js/app.js b/frontend/js/app.js index 92dc1de..b68b608 100644 --- a/frontend/js/app.js +++ b/frontend/js/app.js @@ -136,7 +136,7 @@ function uploadFiles(files) { app.uploadStatus.percentDone = 0; asyncForEach(files, function (file, callback) { - var path = encode(sanitize(app.path + '/' + file.name)); + var path = encode(sanitize(app.path + '/' + (file.webkitRelativePath || file.name))); var formData = new FormData(); formData.append('file', file); @@ -164,10 +164,13 @@ function uploadFiles(files) { } function dragOver(event) { + event.stopPropagation(); event.preventDefault(); + event.dataTransfer.dropEffect = 'copy'; } function drop(event) { + event.stopPropagation(); event.preventDefault(); uploadFiles(event.dataTransfer.files || []); } @@ -275,9 +278,7 @@ var app = new Vue({ refresh(); }); - }).catch(function () { - console.log('delete error:', arguments); - }); + }).catch(function () {}); }, onRename: function (entry) { var that = this; @@ -294,9 +295,7 @@ var app = new Vue({ refresh(); }); - }).catch(function (error) { - that.$message.error(error.message); - }); + }).catch(function () {}); }, onNewFolder: function () { var that = this; @@ -314,9 +313,7 @@ var app = new Vue({ refresh(); }); - }).catch(function (error) { - that.$message.error(error.message); - }); + }).catch(function () {}); }, prettyDate: function (row, column, cellValue, index) { var date = new Date(cellValue),