[FIX] web_tour: make tour manager more robust
Before this commit, it could happen that the trigger element of a step was in the DOM at time t0, but was no longer in the DOM at time t1, when we tried to actually execute the step, because of a non zero running_step_delay. This commit checks again the presence of the trigger in the DOM at t1, and if it isn't resets the step. The same reasonning applies to the ui blocked check: we never want to run a step if the ui is blocked. X-original-commit: 119d509feb2cb93c648160af2848146e9c623e21 Part-of: odoo/odoo#85573
This commit is contained in:
@@ -507,6 +507,15 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
|
||||
}
|
||||
|
||||
function exec() {
|
||||
const anchorIsInDocument = tip.widget.$anchor[0].ownerDocument.contains(tip.widget.$anchor[0]);
|
||||
const uiIsBlocked = $('body').hasClass('o_ui_blocked');
|
||||
if (!anchorIsInDocument || uiIsBlocked) {
|
||||
// trigger is no longer in the DOM, or UI is now blocked, so run the same step again
|
||||
self._deactivate_tip(self.active_tooltips[tour_name]);
|
||||
self._to_next_step(tour_name, 0);
|
||||
self.update();
|
||||
return;
|
||||
}
|
||||
var action_helper = new RunningTourActionHelper(tip.widget);
|
||||
do_before_unload(self._consume_tip.bind(self, tip, tour_name));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user