MCPcopy
hub / github.com/ampproject/amphtml / onResizeSuccess

Method onResizeSuccess

3p/ampcontext.js:278–286  ·  view source on GitHub ↗

* Allows a creative to set the callback function for when the resize * request returns a success. The callback should be set before resizeAd * is ever called. * @param {function(number, number)} callback Function to call if the resize * request succeeds.

(callback)

Source from the content-addressed store, hash-verified

276 * request succeeds.
277 */
278 onResizeSuccess(callback) {
279 this.client_.registerCallback(
280 MessageType_Enum.EMBED_SIZE_CHANGED,
281 (obj) => {
282 callback(obj['requestedHeight'], obj['requestedWidth']);
283 }
284 );
285 this.sendDeprecationNotice_('onResizeSuccess');
286 }
287
288 /**
289 * Allows a creative to set the callback function for when the resize

Callers 1

Calls 3

registerCallbackMethod · 0.80
callbackFunction · 0.50

Tested by

no test coverage detected