Floating page content bugfix and prevent incompatable image uploads. Fixes #26.

This commit is contained in:
Dan Brown 2015-12-01 20:26:09 +00:00
parent b498b60cdd
commit 9969698783
3 changed files with 15 additions and 1 deletions

View File

@ -110,7 +110,11 @@ class ImageController extends Controller
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') . '/';

View File

@ -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);
});
}
});
},

View File

@ -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;
}