From 21fb7a1f000f61ff29e35f4e7093674d57afeb49 Mon Sep 17 00:00:00 2001
From: jpr-odoo <jpr@openerp.com>
Date: Wed, 24 Jul 2019 11:16:45 +0000
Subject: [PATCH] [FIX] website_slides: fix the title of the page in fullscreen
 mode

before this commit, the title of the page is not correct in fullscreen mode

after this commit, set the lesson name as the page title in the fullscreen mode
and changed the title of the page as per click on lesson name

task-2040899

closes odoo/odoo#35161

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
---
 .../static/src/js/slides_course_fullscreen_player.js            | 2 ++
 .../views/website_slides_templates_lesson_fullscreen.xml        | 1 +
 2 files changed, 3 insertions(+)

diff --git a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
index 093f147aff6c..5c68c8cc9b50 100644
--- a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
+++ b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
@@ -600,6 +600,8 @@ odoo.define('website_slides.fullscreen', function (require) {
             var slide = this.get('slide');
             self._pushUrlState();
             return this._fetchSlideContent().then(function() { // render content
+                var websiteName = document.title.split(" | ")[1]; // get the website name from title
+                document.title =  (websiteName) ? slide.name + ' | ' + websiteName : slide.name;
                 return self._renderSlide();
             }).then(function() {
                 if (slide._autoSetDone && !session.is_website_user) {  // no useless RPC call
diff --git a/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml b/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml
index 0b28617a206e..593fb2bfab12 100644
--- a/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml
+++ b/addons/website_slides/views/website_slides_templates_lesson_fullscreen.xml
@@ -7,6 +7,7 @@
         <link rel="canonical" t-att-href="slide.website_url" />
     </t>
     <t t-call="website.layout">
+        <t t-set="main_object" t-value="slide"/>
         <div class="o_wslides_fs_main d-flex flex-column font-weight-light"
             t-att-data-channel-id="slide.channel_id.id"
             t-att-data-channel-enroll="slide.channel_id.enroll"
-- 
GitLab