diff options
| author | Antony Lesuisse <al@openerp.com> | 2014-05-07 17:32:23 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-05-07 17:32:23 +0200 |
| commit | 56eeefdfdabd0cd8875b7f4989f12b8caf988c47 (patch) | |
| tree | b7eedab2ac1f927d8a65e9244561ec46abba2f5f /addons/website/static/src | |
| parent | 9086f5b6132bc1863d0cc791f0562a067c64ca83 (diff) | |
| parent | 8065294976436c3dfabde1c5f392e71eaaa8ff8a (diff) | |
[MERGE] trunk-websit-al-refactor by chm
- allow fiscal position change on sale orders
- public user on website
- simplify website_sale sale.order and shopping cart code
- remove preprocess_request
bzr revid: al@openerp.com-20140507153223-q73u5lhyrfw98o3a
Diffstat (limited to 'addons/website/static/src')
| -rw-r--r-- | addons/website/static/src/js/website.tour.js | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 2a661b4cc9b..0544d29df08 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -104,11 +104,11 @@ var T = website.Tour = { if (tour.path && !window.location.href.match(new RegExp("("+T.getLang()+")?"+tour.path+"#?$", "i"))) { var href = "/"+T.getLang()+tour.path; console.log("Tour Begin from run method (redirection to "+href+")"); - T.saveState(tour.id, mode || tour.mode, -1); + T.saveState(tour.id, mode || tour.mode, -1, 0); window.location.href = href; } else { console.log("Tour Begin from run method"); - T.saveState(tour.id, mode || tour.mode, 0); + T.saveState(tour.id, mode || tour.mode, 0, 0); T.running(); } }, @@ -311,7 +311,7 @@ var T = website.Tour = { }; window.location.hash = ""; console.log("Tour Begin from url hash"); - T.saveState(state.id, state.mode, state.step_id); + T.saveState(state.id, state.mode, state.step_id, 0); } if (!state.id) { return; @@ -341,8 +341,8 @@ var T = website.Tour = { } return tour_ids; }, - saveState: function (tour_id, mode, step_id) { - localStorage.setItem("tour", JSON.stringify({"id":tour_id, "mode":mode, "step_id":step_id || 0, "time": this.time})); + saveState: function (tour_id, mode, step_id, number) { + localStorage.setItem("tour", JSON.stringify({"id":tour_id, "mode":mode, "step_id":step_id || 0, "time": this.time, "number": number+1})); }, reset: function () { var state = T.getState(); @@ -402,6 +402,7 @@ var T = website.Tour = { if (T.check(next)) { clearTimeout(T.currentTimer); // use an other timeout for cke dom loading + T.saveState(state.id, state.mode, state.step.id, 0); setTimeout(function () { T.nextStep(next); }, T.defaultDelay); @@ -421,7 +422,13 @@ var T = website.Tour = { } step = step || state.step; - T.saveState(state.id, state.mode, step.id); + var next = state.tour.steps[step.id+1]; + + if (state.number > 3) { + T.error(next, "Cycling. Can't reach the next step"); + } + + T.saveState(state.id, state.mode, step.id, state.number); if (step.id !== state.step_id) { console.log("Tour Step: '" + (step._title || step.title) + "' (" + (new Date().getTime() - this.time) + "ms)"); @@ -433,7 +440,6 @@ var T = website.Tour = { step.onload(); } - var next = state.tour.steps[step.id+1]; if (next) { setTimeout(function () { T.waitNextStep(); |
