Powerful and easy to use cms to build websites, blogs or ecommerce stores.
HTML backendblogblog-engineblog-platformbloggingcmscontent-managementcontent-management-systemecommerceecommerce-platformno-codepage-builderphpphp-cmsphp7php8self-hostedshopping-cartweb-applicationwebsite-builder
Oembed load provider javascript to fully render widget
givanz17f5fc34a144
diff --git a/public/js/vvvebjs/components-embeds.js b/public/js/vvvebjs/components-embeds.jsindex 4cb37c1..d180bfb 100755--- a/public/js/vvvebjs/components-embeds.js+++ b/public/js/vvvebjs/components-embeds.js@@ -37,22 +37,27 @@ Vvveb.Components.extend("_base", "embeds/embed", {htmlAttr: "data-url",inputtype: TextInput,onChange: function(node, value) {- let element = node[0];-- element.innerHTML = `<div class="alert alert-light d-flex justify-content-center">+ node.innerHTML = `<div class="alert alert-light d-flex justify-content-center"><div class="spinner-border m-5" role="status"><span class="visually-hidden">Loading...</span></div></div>`;getOembed(value).then(response => {- element.innerHTML = response.html;+ node.innerHTML = response.html;let containerW = node.offsetWidth;- let iframe = element.querySelector("iframe");- let ratio = containerW / iframe.offsetWidth;-- iframe.setAttribute("width", (width * ratio));- iframe.setAttribute("height", (height * ratio));+ let iframe = node.querySelector("iframe");+ if (iframe) {+ let ratio = containerW / iframe.offsetWidth;+ iframe.setAttribute("width", (width * ratio));+ iframe.setAttribute("height", (height * ratio));+ }++ let arr = node.querySelectorAll('script').forEach(script => {+ let newScript = Vvveb.Builder.frameDoc.createElement("script");+ newScript.src = script.src;+ script.replaceWith(newScript);+ });}).catch(error => console.log(error));