MCPcopy Index your code
hub / github.com/ampproject/amphtml / tweetCreated

Function tweetCreated

3p/twitter.js:78–92  ·  view source on GitHub ↗

* Handles a tweet or moment being created, resizing as necessary. * @param {!Object} twttr * @param {?Element} el

(twttr, el)

Source from the content-addressed store, hash-verified

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

Callers 1

twitterFunction · 0.85

Calls 2

resizeFunction · 0.85
noContentAvailableMethod · 0.80

Tested by

no test coverage detected