diff options
| author | Aaron Bohy <aab@odoo.com> | 2016-07-20 13:24:46 +0200 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2016-07-20 17:59:48 +0200 |
| commit | f7703c5d9b3ccfaf16ec6a233eb71ca3d0c9cd70 (patch) | |
| tree | 68bf614910045a74daf6ca58db650cf9f7ec501f /addons | |
| parent | 0a8ec457693351fa32183ffc20bbf6590e71144a (diff) | |
[FIX] web_tour: tips activation when a modal is open
When a modal is open, we only activate tips that are inside the modal.
The former solution didn't work when the tip's selector contains ','
(often used when the selector is different in community and enterprise,
e.g. selectors for apps), because the modal restriction was only
applied on the first part of the selector.
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_tour/static/src/js/tour_manager.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/addons/web_tour/static/src/js/tour_manager.js b/addons/web_tour/static/src/js/tour_manager.js index a250274d45f..6c6cd1caf37 100644 --- a/addons/web_tour/static/src/js/tour_manager.js +++ b/addons/web_tour/static/src/js/tour_manager.js @@ -96,7 +96,7 @@ return core.Class.extend({ * active tours otherwise). Should be called each time the DOM changes. */ update: function (tour_name) { - this.in_modal = this.$body.hasClass('modal-open'); + this.$modal_displayed = $('.modal:visible').last(); tour_name = this.running_tour || tour_name; if (tour_name) { this._check_for_tooltip(this.active_tooltips[tour_name], tour_name); @@ -105,7 +105,13 @@ return core.Class.extend({ } }, _check_for_tooltip: function (tip, tour_name) { - var $trigger = $((this.in_modal ? '.modal ' : '') + tip.trigger).filter(':visible').first(); + var $trigger; + if (this.$modal_displayed.length) { + $trigger = this.$modal_displayed.find(tip.trigger); + } else { + $trigger = $(tip.trigger); + } + $trigger = $trigger.filter(':visible').first(); var extra_trigger = tip.extra_trigger ? $(tip.extra_trigger).filter(':visible').length : true; var triggered = $trigger.length && extra_trigger; if (triggered) { |
