[IMP] website: improved tours error message and race conditions

This commit is contained in:
Christophe Matthieu 2015-04-28 15:53:32 +02:00 committed by David Monjoie
parent 21e65ae3c6
commit e9c3336003
2 changed files with 12 additions and 1 deletions

View File

@ -59,6 +59,7 @@ var localStorage = window.localStorage;
var Tour = {
tours: {},
defaultDelay: 50,
autoRunning: true,
retryRunningDelay: 1000,
errorDelay: 5000,
state: null,
@ -339,6 +340,7 @@ var Tour = {
},
error: function (step, message) {
var state = Tour.getState();
console.log(state.tour.steps.slice());
message += '\n tour: ' + state.id
+ (step ? '\n step: ' + step.id + ": '" + (step._title || step.title) + "'" : '' )
+ '\n href: ' + window.location.href
@ -568,6 +570,10 @@ openerp.Tour = Tour;
/////////////////////////////////////////////////
$(document).ready(Tour.running);
$(document).ready(function () {
if (Tour.autoRunning) {
Tour.running();
};
});
}());

View File

@ -394,5 +394,10 @@
$('[data-target="#oe_applications"]').attr("data-target", "#oe_applications_collapse");
});
openerp.Tour.autoRunning = false;
website.ready().then(function () {
setTimeout(openerp.Tour.running,0);
});
return website;
})();