remove embedcode id prefix (#472)
This commit is contained in:
@@ -49,23 +49,16 @@ export default {
|
||||
computed: {
|
||||
embedCode() {
|
||||
// eslint-disable no-useless-escape
|
||||
return `${this.iframeCode}<script type="text/javascript" onload="initForm('${this.form.slug}')" src="${appUrl("/widgets/iframe.min.js")}"><\/script>`
|
||||
return `${this.iframeCode}<script type="text/javascript" onload="initEmbed('${this.form.slug}')" src="${appUrl("/widgets/iframe.min.js")}"><\/script>`
|
||||
},
|
||||
iframeCode() {
|
||||
const share_url = this.extraQueryParam
|
||||
? this.form.share_url + "?" + this.extraQueryParam
|
||||
: this.form.share_url + this.extraQueryParam
|
||||
return (
|
||||
'<iframe style="border:none;width:100%;" id="' +
|
||||
this.iframeId +
|
||||
'" src="' +
|
||||
share_url +
|
||||
'"></iframe>'
|
||||
'<iframe style="border:none;width:100%;" id="' + this.form.slug + '" src="' + share_url + '"></iframe>'
|
||||
)
|
||||
},
|
||||
iframeId() {
|
||||
return "form-" + this.form.slug
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
methods: {},
|
||||
|
||||
4
client/public/widgets/iframe.js
vendored
4
client/public/widgets/iframe.js
vendored
@@ -473,7 +473,7 @@
|
||||
* Starting from here is OpnForm custom code.
|
||||
* @type {string}
|
||||
*/
|
||||
function initForm(formSlug) {
|
||||
function initEmbed(formSlug) {
|
||||
if (!formSlug) {
|
||||
return
|
||||
}
|
||||
@@ -493,6 +493,6 @@ function initForm(formSlug) {
|
||||
})
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
iFrameResize({log: false, checkOrigin: false}, '#form-' + formSlug)
|
||||
iFrameResize({log: false, checkOrigin: false}, '#' + formSlug)
|
||||
})
|
||||
}
|
||||
|
||||
2
client/public/widgets/iframe.min.js
vendored
2
client/public/widgets/iframe.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user