Commit da91071d authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[NTP] send message to iframed doodle when expansion is complete

When the iframe finishes resizing send a postMessage to the doodle
iframe letting it know the expansion has finished.

b/118340003

Change-Id: Ic974ca58f51882d932e8de10c5706990f8f462cd
Reviewed-on: https://chromium-review.googlesource.com/c/1323620Reviewed-by: default avatarRamya Nagarajan <ramyan@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607729}
parent 149e294e
......@@ -911,9 +911,17 @@ function handlePostMessage(event) {
let height = args.height || null;
let duration = args.duration || '0s';
let iframe = $(IDS.LOGO_DOODLE_IFRAME);
var transitionCallback = function() {
iframe.removeEventListener('webkitTransitionEnd', transitionCallback);
iframe.contentWindow.postMessage(
{cmd: 'resizeComplete'}, 'https://www.google.com');
};
iframe.addEventListener('webkitTransitionEnd', transitionCallback, false);
document.body.style.setProperty('--logo-iframe-resize-duration', duration);
document.body.style.setProperty('--logo-iframe-height', height);
document.body.style.setProperty('--logo-iframe-width', width);
document.body.style.setProperty('--logo-iframe-resize-duration', duration);
} else if (cmd === 'startEditLink') {
$(IDS.CUSTOM_LINKS_EDIT_IFRAME)
.contentWindow.postMessage({cmd: 'linkData', tid: args.tid}, '*');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment