From 510c86942bde18ee408e034003065fbde7a07b90 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 26 Jul 2019 16:29:13 +0300 Subject: merge embed changes from production --- vnext/src/utils/embed.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vnext/src/utils/embed.js b/vnext/src/utils/embed.js index be96d036..f7f55eb7 100644 --- a/vnext/src/utils/embed.js +++ b/vnext/src/utils/embed.js @@ -72,8 +72,8 @@ function makeIframe(src, w, h, scrolling='no') { } function makeResizableToRatio(element, ratio) { - element.dataset['ratio'] = ratio; - makeResizable(element, w => w * element.dataset['ratio']); + element.setAttribute('data-ratio', ratio); + makeResizable(element, w => w * element.getAttribute('data-ratio')); } // calcHeight :: Number -> Number -- calculate element height for a given width @@ -205,7 +205,11 @@ function getEmbeddableLinkTypes() { .split('&') .map(s => s.split('=')) .forEach(z => pp[z[0]] = z[1]); - let embedArgs = { rel: '0' }; + let embedArgs = { + rel: '0', + enablejsapi: '1', + origin: `${window.location.protocol}//${window.location.host}` + }; if (pp.t) { const tre = /^(?:(\d+)|(?:(\d+)h)?(?:(\d+)m)?(\d+)s|(?:(\d+)h)?(\d+)m|(\d+)h)$/i; let [, t, h, m, s, h1, m1, h2] = tre.exec(pp.t); -- cgit v1.2.3