diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 1f458085960..e09366d2b81 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -265,10 +265,6 @@ var test = { id: tour.id, run: function (force) { - var url = new website.UrlParser(window.location.href); - if (tour.startPath && url.pathname !== tour.startPath) { - throw new Error(tour.startPath); - } if (force === true) { this.reset(); } @@ -296,6 +292,7 @@ } else if (step.trigger.id === 'change') { var currentValue = $element.val(); var options = $element[0].options; + // FIXME: It may be necessary to set a particular value var newValue = _.find(options, function (option) { return option.value !== currentValue; }).value; @@ -304,14 +301,22 @@ $element.trigger($.Event("click", { srcElement: $element })); } } - var lastStepId = window.localStorage.getItem(testId); - var currentStep = actionSteps.shift(); - if (lastStepId) { - while (currentStep && lastStepId !== currentStep.stepId) { - currentStep = actionSteps.shift(); + var url = new website.UrlParser(window.location.href); + if (tour.startPath && url.pathname !== tour.startPath) { + window.localStorage.setItem(testId, actionSteps[0].stepId); + window.location.href = tour.startPath; + } else { + var lastStepId = window.localStorage.getItem(testId); + var currentStep = actionSteps.shift(); + if (lastStepId) { + while (currentStep && lastStepId !== currentStep.stepId) { + currentStep = actionSteps.shift(); + } } + setTimeout(function () { + executeStep(currentStep); + }, 0); } - executeStep(currentStep); }, reset: function () { window.localStorage.removeItem(testId); diff --git a/addons/website_sale/static/src/js/website.tour.shop.js b/addons/website_sale/static/src/js/website.tour.shop.js index de84aa29276..9fc34fc0f17 100644 --- a/addons/website_sale/static/src/js/website.tour.shop.js +++ b/addons/website_sale/static/src/js/website.tour.shop.js @@ -109,11 +109,7 @@ placement: 'bottom', title: "Describe the product for your audience", content: "Insert blocks like text-image, or gallery to fully describe the product and make your visitors want to buy this product.", - trigger: { - emitter: editor, - type: 'openerp', - id: 'rte:ready', - }, + trigger: 'click', }, { stepId: 'drag-big-picture', @@ -134,12 +130,18 @@ }, { stepId: 'publish-product', - element: 'button.js_publish_btn', + element: '.js_publish_management button.js_publish_btn.btn-danger', placement: 'top', title: "Publish your product", content: "Click to publish your product so your customers can see it.", trigger: 'click', }, + { + stepId: 'congratulations', + title: "Congratulations", + content: "Congratulations! You just created and published your first product.", + template: self.popover({ end: "Ok" }), + }, ]; return this._super(); },