Floating page content bugfix and prevent incompatable image uploads. Fixes #26.
This commit is contained in:
		
							parent
							
								
									b498b60cdd
								
							
						
					
					
						commit
						9969698783
					
				| 
						 | 
				
			
			@ -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') . '/';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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);
 | 
			
		||||
                        });
 | 
			
		||||
                    }
 | 
			
		||||
                });
 | 
			
		||||
            },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue