From 8ab2adfbdd38f0a5389816c7ccea44327cbec35e Mon Sep 17 00:00:00 2001 From: Julien Banken Date: Mon, 19 Jul 2021 06:48:51 +0000 Subject: [PATCH] [FIX] slides: prevent the # anchors of the PDF controllers from triggering a scroll jump PURPOSE Currently, the PDF viewer is loaded from an iframe and the PDF controllers contains empty anchor links. When the user clicks on one of these links, the browsers based on Chromium will trigger a "scroll jump" and the iframe will be placed at the top of the browser window. When the PDF document is larger than the viewport, this behavior can be quite annoying: The user will have to scroll the browser window to see the controllers each time they click on a controller (-> link) as (1) the controllers triggers a scroll jump and (2) the controllers are below the document that does not fit entirely on screen. To avoid that, the links of the PDF controllers will be replaced with spans. The controllers will then no longer trigger a scroll jump. SPECS - Replace the links of the PDF controllers with spans. - Add css rules to prevent user selection. LINKS Task id: 2500574 closes odoo/odoo#73937 Signed-off-by: Thibault Delavallee (tde) --- .../static/src/scss/website_slides.scss | 7 ++++- .../website_slides_templates_lesson_embed.xml | 26 +++++++++---------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/addons/website_slides/static/src/scss/website_slides.scss b/addons/website_slides/static/src/scss/website_slides.scss index 17ab57c7aa3..a46bab26ab7 100644 --- a/addons/website_slides/static/src/scss/website_slides.scss +++ b/addons/website_slides/static/src/scss/website_slides.scss @@ -574,7 +574,12 @@ $o-wslides-fs-side-width: 300px; background-image: linear-gradient(120deg, $o-wslides-color-dark1, $o-wslides-color-dark2); } - .oe_slides_panel_footer a, .oe_slides_share_bar a { + .oe_slides_panel_footer span[role="button"], + .oe_slides_panel_footer a, + .oe_slides_share_bar span[role="button"], + .oe_slides_share_bar a { + cursor: pointer; + user-select: none; @include o-hover-text-color(rgba(white, 0.7), white); &.disabled { diff --git a/addons/website_slides/views/website_slides_templates_lesson_embed.xml b/addons/website_slides/views/website_slides_templates_lesson_embed.xml index ee2071bfd95..bf990f632d6 100644 --- a/addons/website_slides/views/website_slides_templates_lesson_embed.xml +++ b/addons/website_slides/views/website_slides_templates_lesson_embed.xml @@ -104,28 +104,28 @@ - + - - + + - + +
- + - +