Skip to content

Commit

Permalink
Merge pull request #2 from khoannd98/feature/fix-image-upload
Browse files Browse the repository at this point in the history
fix image preview not show when upload
  • Loading branch information
thaopw authored Aug 17, 2023
2 parents dcff75a + 5329d79 commit f86d788
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion view/adminhtml/ui_component/blog_author_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
<item name="template" xsi:type="string">ui/form/element/uploader/uploader</item>
</item>
</argument>
<settings>
Expand Down Expand Up @@ -129,4 +130,4 @@
</argument>
</field>
</fieldset>
</form>
</form>
3 changes: 2 additions & 1 deletion view/adminhtml/ui_component/blog_post_form.xml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@
<item name="validation" xsi:type="array">
<item name="required-entry" xsi:type="boolean">true</item>
</item>
<item name="template" xsi:type="string">ui/form/element/uploader/uploader</item>
</item>
</argument>
<settings>
Expand Down Expand Up @@ -482,4 +483,4 @@
</insertListing>
</modal>
</fieldset>
</form>
</form>
6 changes: 3 additions & 3 deletions view/adminhtml/web/template/image-preview.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="file-uploader-summary">
<div class="file-uploader-preview image-uploader-preview">
<a class="image-uploader-preview-link" attr="href: $parent.getFilePreview($file)" target="_blank">
<div class="file-uploader-spinner image-uploader-spinner" />
<div class="file-uploader-spinner image-uploader-spinner"></div>
<img
class="preview-image"
tabindex="0"
Expand All @@ -20,12 +20,12 @@
attr="title: $t('Delete image')"
disable="$parent.disabled"
click="$parent.removeFile.bind($parent, $file)">
<span translate="'Delete image'"/>
<span translate="'Delete image'"></span>
</button>
</div>
</div>

<div class="file-uploader-filename" text="$file.name"/>
<div class="file-uploader-filename" text="$file.name"></div>
<div class="file-uploader-meta">
<text args="$file.previewWidth"/>x<text args="$file.previewHeight"/>,
<text args="$parent.formatSize($file.size)"/>
Expand Down

0 comments on commit f86d788

Please sign in to comment.