Fix Windows tweet schrinking phenomenon (#19686)

This commit is contained in:
Ben Halpern 2023-07-06 17:25:04 -04:00 committed by GitHub
parent c7bb3be603
commit f88e18c2de
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -16,7 +16,7 @@ class TweetTag < LiquidTagBase
if (data && data['method'] === 'twttr.private.resize' && data['params'] && data['params']['0']) {
iframe.style.height = data['params']['0']['height'] + 0.5 + 'px';
iframe.style.minHeight = data['params']['0']['height'] + 0.5 + 'px';
iframe.style.width = data['params']['0']['width'] + 'px';
iframe.style.width = data['params']['0']['width'] + 'px !important';
}
break;
}

View file

@ -1,6 +1,7 @@
<% obj_id = "#{id}-#{rand(1_000)}" %>
<iframe
class="tweet-embed"
scrolling="no"
id="tweet-<%= obj_id %>"
src="https://platform.twitter.com/embed/Tweet.html?id=<%= id %>">
</iframe>