Skip to content

Commit

Permalink
Floating page content bugfix and prevent incompatable image uploads. …
Browse files Browse the repository at this point in the history
…Fixes #26.
  • Loading branch information
ssddanbrown committed Dec 1, 2015
1 parent b498b60 commit 9969698
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/Http/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ public function getThumbnail($image, $width = 220, $height = 220, $keepRatio = f
public function upload(Request $request)
{
$this->checkPermission('image-create');
$this->validate($request, [
'file' => 'image|mimes:jpeg,gif,png'
]);
$imageUpload = $request->file('file');

$name = str_replace(' ', '-', $imageUpload->getClientOriginalName());
$storageName = substr(sha1(time()), 0, 10) . '-' . $name;
$imagePath = '/uploads/images/' . Date('Y-m-M') . '/';
Expand Down
6 changes: 6 additions & 0 deletions resources/assets/js/components/image-manager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,12 @@
dz.removeFile(file);
});
});
this.on('error', function(file, errorMessage, xhr) {
if(errorMessage.file) {
$(file.previewElement).find('[data-dz-errormessage]').text(errorMessage.file[0]);
}
console.log(errorMessage);
});
}
});
},
Expand Down
6 changes: 5 additions & 1 deletion resources/assets/sass/_pages.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
max-width: 840px;
overflow-wrap: break-word;
.align-left {
float: left !important;
text-align: left;
}
img.align-left, table.align-left {
float: left !important;
margin: $-xs $-s $-xs 0;
}
.align-right {
float: right !important;
}
img.align-right, table.align-right {
text-align: right;
margin: $-xs 0 $-xs $-s;
}
Expand Down

0 comments on commit 9969698

Please sign in to comment.