Skip to content

Commit

Permalink
Add a hint how to enable HTML preview
Browse files Browse the repository at this point in the history
  • Loading branch information
alies-dev committed Nov 9, 2022
1 parent 37ef1a0 commit d47d5a7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/js/field.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"/js/field.js": "/js/field.js?id=4a236deae1810202607f4b6a0e059b0c"
"/js/field.js": "/js/field.js?id=eccb11b423a3c19387a78cd92c00d6db"
}
5 changes: 2 additions & 3 deletions resources/js/components/DetailField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ export default {
props: ['index', 'resource', 'resourceName', 'resourceId', 'field'],
beforeCreate() {
const uniqueId = Math.random().toString(36).slice(-5);
this.iframeId = `previewUnlayerHtmlIframe-${uniqueId}`;
this.iframeId = `${this.field.uniqueKey}-iframe`;
},
mounted() {
let iframe = document.getElementById(this.iframeId);
this.setIframeContent(iframe, this.field.html);
this.setIframeContent(iframe, this.field.html || 'HTML is not set for preview, use <code>Unlayer::html()</code>');
this.resizeIFrameToFitContent(iframe)
},
Expand Down

0 comments on commit d47d5a7

Please sign in to comment.