Skip to content

Commit

Permalink
Merge pull request #1 from statikbe/fix-image-extended
Browse files Browse the repository at this point in the history
fix image-extended copyright text not reloaded and image path broken
  • Loading branch information
sten authored Jun 14, 2018
2 parents 7f5398d + 4fe3b29 commit 0f80033
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# [1.0.3] 14-06-2018
## Updated
- Updated extended_image to add a slash before the image path to render the image correctly in javascript.
- Fix copyright bug: the text was not shown in the input after reloading the page.

# [1.0.2] 16-05-2018
## Updated
- Updated README
Expand Down
2 changes: 1 addition & 1 deletion resources/js/sir-trevor/blocks/image_extended.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SirTrevor.Blocks.ImageExtended = SirTrevor.Blocks.Image.extend({

loadData: function(data){
$(this.editor).html($('<img>', { src: function () { if (data.image) { return data.image } else { return data.file.url } }})).show();
$(this.editor).append($('<input>', {type: 'text', class: 'copyright', name: 'text', placeholder: 'Copyright', value: data.copyright}));
$(this.editor).append($('<input>', {type: 'text', class: 'copyright', name: 'copyright', placeholder: 'Copyright', value: data.copyright}));
},

onBlockRender: function(){
Expand Down
2 changes: 1 addition & 1 deletion src/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function upload(Request $request)
$path = $file->store($config['upload_directory']);
};

$publicPath = str_replace('public', 'storage', $path);
$publicPath = '/'.str_replace('public', 'storage', $path);

return ['image' => $publicPath];
}
Expand Down

0 comments on commit 0f80033

Please sign in to comment.