[FIX] website: fix background video placement in popup

Before this commit, if you add a background video in a popup, the video
frame will not setup properly because the _adjustIframe function cannot
find wrapperWidth and its ratio.

After this commit, _adjustIframe will be called again once the popup
is opened.

task-2251203

X-original-commit: 2b571bd012c8a1226d17edb2ee9dd2e6f74ce5d1
Part-of: odoo/odoo#79802
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit is contained in:
Siddarth Gajjar
2021-11-16 10:49:19 +00:00
committed by qsm-odoo
co-authored by qsm-odoo
parent 77324d5dde
commit a66d347606
@@ -697,6 +697,18 @@ registry.backgroundVideo = publicWidget.Widget.extend({
$(window).on('resize.' + this.iframeID, throttledUpdate);
const $modal = this.$target.closest('.modal');
if ($modal.length) {
$modal.on('show.bs.modal', () => {
const videoContainerEl = this.$target[0].querySelector('.o_bg_video_container');
videoContainerEl.classList.add('d-none');
});
$modal.on('shown.bs.modal', () => {
this._adjustIframe();
const videoContainerEl = this.$target[0].querySelector('.o_bg_video_container');
videoContainerEl.classList.remove('d-none');
});
}
return Promise.all(proms).then(() => this._appendBgVideo());
},
/**