diff options
| author | Jeremy Kersten <jke@odoo.com> | 2018-08-22 16:49:19 +0200 |
|---|---|---|
| committer | Jeremy Kersten <jke@odoo.com> | 2018-08-23 13:49:01 +0200 |
| commit | 5b0327f6501e479d39a88df9eb3d685dbdfe69d6 (patch) | |
| tree | 729e2b1bc8c5fdd8dc7a7672305820ba106f6d07 | |
| parent | 2f4358b921b619257879ac3a60daeeae7876a1e4 (diff) | |
[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
| -rw-r--r-- | addons/website/static/src/js/website.js | 10 | ||||
| -rw-r--r-- | addons/website_forum/static/src/js/website_tour_forum.js | 2 |
2 files changed, 12 insertions, 0 deletions
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, }, { |
