Skip to content
Snippets Groups Projects
Commit 2b571bd0 authored by Siddarth Gajjar's avatar Siddarth Gajjar Committed by qsm-odoo
Browse files

[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

Part-of: odoo/odoo#63634
Co-authored-by: default avatarqsm-odoo <qsm@odoo.com>
parent ca5270df
No related branches found
No related tags found
No related merge requests found
......@@ -682,6 +682,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());
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment