* Handles a tweet or moment being created, resizing as necessary. * @param {!Object} twttr * @param {?Element} el
(twttr, el)
| 76 | * @param {?Element} el |
| 77 | */ |
| 78 | function tweetCreated(twttr, el) { |
| 79 | if (!el) { |
| 80 | global.context.noContentAvailable(); |
| 81 | return; |
| 82 | } |
| 83 | |
| 84 | resize(/** @type {!Element} */ (el)); |
| 85 | twttr.events.bind('resize', (event) => { |
| 86 | // To be safe, make sure the resize event was triggered for the widget we |
| 87 | // created below. |
| 88 | if (el === event.target) { |
| 89 | resize(/** @type {!Element} */ (el)); |
| 90 | } |
| 91 | }); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * @param {!Element} container |
no test coverage detected