[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
This commit is contained in:
Younn Olivier
2022-06-24 10:28:06 +02:00
committed by qsm-odoo
parent 6aac2bec6f
commit 8fb0aeadcf
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -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];
@@ -17,6 +17,7 @@
<div class="o_iframe_container" t-att-class="{ 'o_is_mobile': this.websiteContext.isMobile }">
<BlockIframe/>
<iframe t-att-src="iframeFallbackUrl"
class="o_ignore_in_tour"
t-att-class="{ 'd-none': this.websiteContext.edition }"
t-ref="iframefallback"/>
<iframe t-att-src="initialUrl"