From 8c993deca63fd80416989fc247d19551ce757b40 Mon Sep 17 00:00:00 2001 From: Patrick Hoste Date: Wed, 22 Nov 2023 11:06:37 +0100 Subject: [PATCH] [REV] website_slides : Adjust container to contain the full course name This reverts commit 27a1ccc8 which fixed the container height when course name was too long. It added a 'visibility: hidden' style which caused an issue on the course left bar where the progress bar and completed tag are located next to each other. Task-3607404 X-original-commit: cac68b35777210c3f96a5bd187b479589716145d Part-of: odoo/odoo#151736 --- .../static/src/js/slides_course_page.js | 24 ++++--------------- .../static/src/scss/website_slides.scss | 9 ++++--- 2 files changed, 8 insertions(+), 25 deletions(-) diff --git a/addons/website_slides/static/src/js/slides_course_page.js b/addons/website_slides/static/src/js/slides_course_page.js index e0d6bc5d50e..c82f1b18ead 100644 --- a/addons/website_slides/static/src/js/slides_course_page.js +++ b/addons/website_slides/static/src/js/slides_course_page.js @@ -35,22 +35,6 @@ export const SlideCoursePage = publicWidget.Widget.extend({ } }, - /** - * @override - */ - start: function () { - // TODO: we need to clean this code and make the changes in the view in master - const $completed = $('.o_wslides_channel_completion_completed'); - const $progressbar = $('.o_wslides_channel_completion_progressbar'); - if($progressbar.hasClass('d-none')){ - $progressbar.removeClass('d-none').addClass('d-flex').addClass('hidden-progressbar-completed-tag'); - } - if($completed.hasClass('d-none')){ - $completed.removeClass('d-none').addClass('hidden-progressbar-completed-tag'); - } - return this._super.apply(this, arguments) - }, - /** * Greens up the bullet when the slide is completed * @@ -90,12 +74,12 @@ export const SlideCoursePage = publicWidget.Widget.extend({ if (completion < 100) { // Hide the "Completed" text and show the progress bar - $completed.addClass('hidden-progressbar-completed-tag'); - $progressbar.removeClass('hidden-progressbar-completed-tag'); + $completed.addClass('d-none'); + $progressbar.removeClass('d-none').addClass('d-flex'); } else { // Hide the progress bar and show the "Completed" text - $completed.removeClass('hidden-progressbar-completed-tag'); - $progressbar.addClass('hidden-progressbar-completed-tag'); + $completed.removeClass('d-none'); + $progressbar.addClass('d-none').removeClass('d-flex'); } $progressbar.find('.progress-bar').css('width', `${completion}%`); diff --git a/addons/website_slides/static/src/scss/website_slides.scss b/addons/website_slides/static/src/scss/website_slides.scss index 6871271e2c1..cbc2c97cac3 100644 --- a/addons/website_slides/static/src/scss/website_slides.scss +++ b/addons/website_slides/static/src/scss/website_slides.scss @@ -617,11 +617,10 @@ $line-height-truncate: 1.25em; } } -.hidden-progressbar-completed-tag { - visibility: hidden; - @include media-breakpoint-down(sm) { - display: none !important; - } +// Enforce the height of the lesson header, so the DOM element size do not change +// when the completion progressbar become visible / hidden +.o_wslides_lesson_header_container { + height: 80px; } .o_wslides_fs_sidebar_section {