From f7073c0644ea7a02bdf35818c571c3f6567b360d Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 23 Jul 2014 15:15:31 +0200 Subject: [PATCH] [FIX] tour.js: wait must be used for the current step instead of the previous step. Remove setimeout delay for activate the element. --- addons/web/static/src/js/tour.js | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/addons/web/static/src/js/tour.js b/addons/web/static/src/js/tour.js index bebb59d7210..fec189e06f5 100644 --- a/addons/web/static/src/js/tour.js +++ b/addons/web/static/src/js/tour.js @@ -430,7 +430,7 @@ var Tour = { return Tour.error(next, "Can't reach the next step"); } } - checkNext(); + setTimeout(checkNext, 0); }, nextStep: function (step) { var state = Tour.getState(); @@ -458,21 +458,17 @@ var Tour = { step.onload(); } - if (next) { + if (state.mode === "test") { setTimeout(function () { - if (Tour.getState()) { + Tour.autoNextStep(state.tour, step); + if (next && Tour.getState()) { Tour.waitNextStep(); } - if (state.mode === "test") { - setTimeout(function(){ - Tour.autoNextStep(state.tour, step); - }, Tour.defaultDelay); - } - }, next.wait || 0); - } else { - setTimeout(function(){ - Tour.autoNextStep(state.tour, step); - }, Tour.defaultDelay); + }, step.wait || Tour.defaultDelay); + } else if (next) { + setTimeout(Tour.waitNextStep, next.wait || 0); + } + if (!next) { Tour.endTour(); } }, @@ -544,7 +540,7 @@ var Tour = { } } - Tour.testtimer = setTimeout(autoStep, 100); + Tour.testtimer = setTimeout(autoStep, 0); }, autoDragAndDropSnippet: function (selector) { var $thumbnail = $(selector).first();