From 5b0327f6501e479d39a88df9eb3d685dbdfe69d6 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Wed, 22 Aug 2018 16:49:19 +0200 Subject: [PATCH] [IMP] website, website_forum: add a class modal_shown on modal once css animation is completed Use this new class in website_forum to avoid that the tour click during the animation and fail randomly. https://getbootstrap.com/docs/4.0/components/modal/#events --- addons/website/static/src/js/website.js | 10 ++++++++++ .../website_forum/static/src/js/website_tour_forum.js | 2 ++ 2 files changed, 12 insertions(+) diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index c243d3fa840..8cc79e2c0c7 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -11,3 +11,13 @@ weContext.get = function (context) { }, weGetContext(context), context); }; }); + +odoo.define('website.website_modal', function (require) { +'use strict'; + + require('web.dom_ready'); + + $('body').on('shown.bs.modal', function (e) { + $(e.target).addClass('modal_shown'); + }); +}); diff --git a/addons/website_forum/static/src/js/website_tour_forum.js b/addons/website_forum/static/src/js/website_tour_forum.js index bd041f58714..ba178f8cbcb 100644 --- a/addons/website_forum/static/src/js/website_tour_forum.js +++ b/addons/website_forum/static/src/js/website_tour_forum.js @@ -51,6 +51,7 @@ odoo.define("website_forum.tour_forum", function (require) { content: _t("Click to post your question."), position: "bottom", }, { + extra_trigger: 'div.modal.modal_shown', trigger: ".modal-header button.close", auto: true, }, { @@ -64,6 +65,7 @@ odoo.define("website_forum.tour_forum", function (require) { content: _t("Click to post your answer."), position: "bottom", }, { + extra_trigger: 'div.modal.modal_shown', trigger: ".modal-header button.close", auto: true, }, {