Skip to content

Commit

Permalink
Merge pull request #69 from ahmedkandel/master
Browse files Browse the repository at this point in the history
Fix broken upload via button
  • Loading branch information
Krato authored Aug 20, 2019
2 parents 2faaf11 + 0e0ccd9 commit 25acea7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/tool.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions resources/js/components/Manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,8 @@ export default {
},
uploadFiles(data) {
let files = this.formatFiles(data.files);
let folders = this.formatFiles(data.folders);
let files = this.formatFiles(data.files || []);
let folders = this.formatFiles(data.folders || []);
if (files.length > 0) {
this.$emit('uploadFiles', files, 'files');
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/ModalFileManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ export default {
},
uploadFilesByButton(e) {
this.$refs.manager.uploadFiles(e.target.files);
this.$refs.manager.uploadFiles({ files: Array.from(e.target.files) });
},
showInfoItem(item) {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/components/Tool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default {
},
uploadFilesByButton(e) {
this.$refs.manager.uploadFiles(e.target.files, 'files');
this.$refs.manager.uploadFiles({ files: Array.from(e.target.files) }, 'files');
},
openRenameModal(type, path) {
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Services/GetFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function generateId($file)
*/
public function setRelativePath($folder)
{
$defaultPath = $this->storage->path('/');
$defaultPath = $this->storage->getDriver()->getAdapter()->getPathPrefix();

$publicPath = str_replace($defaultPath, '', $folder);

Expand Down Expand Up @@ -463,7 +463,7 @@ public function generateParent($folder)
*/
public function getPaths($currentFolder)
{
$defaultPath = $this->cleanSlashes($this->storage->path('/'));
$defaultPath = $this->cleanSlashes($this->storage->getDriver()->getAdapter()->getPathPrefix());
$currentPath = $this->cleanSlashes($this->storage->path($currentFolder));

$paths = $currentPath;
Expand Down

0 comments on commit 25acea7

Please sign in to comment.