From f8b23df55a27f84c29af3788147a24e83496476a Mon Sep 17 00:00:00 2001 From: Christophe Matthieu <chm@odoo.com> Date: Thu, 19 Jun 2014 17:29:39 +0200 Subject: [PATCH] [FIX] tour.js: fickering of the popover in tutorial mode in backend --- addons/web/static/src/js/tour.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/addons/web/static/src/js/tour.js b/addons/web/static/src/js/tour.js index ba9f71a9a355..54670d8e68e3 100644 --- a/addons/web/static/src/js/tour.js +++ b/addons/web/static/src/js/tour.js @@ -355,18 +355,29 @@ var Tour = { clearTimeout(Tour.testtimer); Tour.closePopover(); }, + _running: false, running: function () { + Tour._running = false; function run () { + //if (Tour._running) return; + Tour._running = true; var state = Tour.getState(); - if (!state) return; + if (!state) { + Tour._running = false; + return; + } else if (state.tour) { if (!Tour._load_template) { - Tour.load_template().then(run); + Tour.load_template().then(function () { + Tour._running = false; + run(); + }); return; } console.log("Tour '"+state.id+"' is running"); Tour.registerSteps(state.tour, state.mode); Tour.nextStep(); + Tour._running = false; } else { if (state.mode === "test" && state.wait >= 10) { Tour.error(state.step, "Tour '"+state.id+"' undefined"); @@ -431,7 +442,7 @@ var Tour = { step = step || state.step; var next = state.tour.steps[step.id+1]; - if (state.number > 3) { + if (state.mode === "test" && state.number > 3) { Tour.error(next, "Cycling. Can't reach the next step"); } -- GitLab