From 8fb0aeadcfa0bc17d675d1a470386a87e14935db Mon Sep 17 00:00:00 2001 From: Younn Olivier Date: Wed, 13 Apr 2022 21:04:30 +0200 Subject: [PATCH] [FIX] web_tour, website: do not query test anchors in iframe fallback Before this commit, when using 'iframe ...' as a selector for a trigger in a tour, the first iframe found was used to query and find the trigger. In the context of this PR, the iframe fallback was used to find the triggers in the website tours. This commit adds a o_ignore_in_tour class, used to filter out those elements in tours. See merge commit for more information. task-2687506 --- addons/web_tour/static/src/js/tour_utils.js | 2 +- .../src/client_actions/website_preview/website_preview.xml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/web_tour/static/src/js/tour_utils.js b/addons/web_tour/static/src/js/tour_utils.js index ca6f11f854d..0a7769dc22f 100644 --- a/addons/web_tour/static/src/js/tour_utils.js +++ b/addons/web_tour/static/src/js/tour_utils.js @@ -47,7 +47,7 @@ function do_before_unload(if_unload_callback, if_not_unload_callback) { function get_jquery_element_from_selector(selector) { if (_.isString(selector) && selector.indexOf('iframe') !== -1) { - var $iframe = $(selector.split('iframe')[0] + ' iframe'); + var $iframe = $(selector.split('iframe')[0] + ' iframe:not(.o_ignore_in_tour)'); var $el = $iframe.contents() .find(selector.split('iframe')[1]); $el.iframeContainer = $iframe[0]; diff --git a/addons/website/static/src/client_actions/website_preview/website_preview.xml b/addons/website/static/src/client_actions/website_preview/website_preview.xml index a5a48b6e774..a670f3f837b 100644 --- a/addons/website/static/src/client_actions/website_preview/website_preview.xml +++ b/addons/website/static/src/client_actions/website_preview/website_preview.xml @@ -17,6 +17,7 @@