[FIX] website_event_track_live: fit divs to video player size

Issue introduced in https://github.com/odoo/odoo/pull/95450

After migrating to 5.1.3 Bootstrap, the col-12 element no
longer had implicit position-relative attribute, meaning that
o_wesession_track_main div was no longer position-relative.

Therefore, children position-absolute elements for loading
and track suggestion at the start / end of the video became
absolute to the window instead, and format failed to match
the video frame anymore, as it should have.

-> FIX : add manually the position-relative back on the live
track container element (see o_wevent_event_track_live).
We also add JS check to make sure we add position-relative
even if templates are not updated in stable, as the screen
is very disturbed otherwise.

Task-3215833

closes odoo/odoo#115430

X-original-commit: 643cdc649bf14d51528e9502266bfbcd62576b6e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
This commit is contained in:
Noe Antoine
2023-03-16 09:37:16 +01:00
parent 129f3d949d
commit dbff4c3a15
2 changed files with 5 additions and 1 deletions
@@ -15,6 +15,10 @@ publicWidget.registry.websiteEventTrackLive = publicWidget.Widget.extend({
start: function () {
var self = this;
return this._super(...arguments).then(function () {
// Remove me in master. Make sure position-relative is set on o_wevent_event_track_live
// in stable otherwise suggestion screen is relative to the window, not to the youtube
// frame, breaking screen display. Loading wheel would not be centered either.
self.$el.addClass('position-relative');
self._setupYoutubePlayer();
});
},
@@ -18,7 +18,7 @@
<!-- Add video -->
<xpath expr="//div[@name='o_wesession_track_main']//div" position="before">
<t t-set="show_youtube_frame" t-value="track.youtube_video_url and (track.is_youtube_replay or track.is_track_soon or track.is_track_live or track.is_track_done)" />
<div t-if="show_youtube_frame" class="flex-grow-1 o_wevent_event_track_live"
<div t-if="show_youtube_frame" class="flex-grow-1 o_wevent_event_track_live position-relative"
t-att-data-track-id="track.id"
t-att-data-track-name="track.name"
t-att-data-track-website-image-url="track.website_image_url"