diff options
author | Vitaly Takmazov | 2019-07-26 16:29:13 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-13 10:37:55 +0300 |
commit | 510c86942bde18ee408e034003065fbde7a07b90 (patch) | |
tree | ad9f0589071ac8424170fdd668bbc940919d6242 /vnext/src/utils/embed.js | |
parent | 94f271e9bdbebfafc927fb3fd85c5b26320cd9a4 (diff) |
merge embed changes from production
Diffstat (limited to 'vnext/src/utils/embed.js')
-rw-r--r-- | vnext/src/utils/embed.js | 10 |
1 files 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); |