[IMP] website tour: add 'reload' triggers

bzr revid: chm@openerp.com-20140120133919-hvdsqax5h6n8mlp3
This commit is contained in:
Christophe Matthieu
2014-01-20 14:39:19 +01:00
parent 7651b8f700
commit 97da0a2e52
@@ -36,6 +36,18 @@
(callback || self.moveToNextStep).apply(self);
});
};
} else if (step.trigger === 'reload') {
step.triggers = function (callback) {
var pill = JSON.parse(localStorage.getItem("website-reload-pill")) || [];
var index = pill.indexOf(step.stepId);
if (index !== -1) {
pill.splice(index,1);
(callback || self.moveToNextStep).apply(self);
} else {
pill.push(step.stepId);
}
localStorage.setItem("website-reload-pill", JSON.stringify(pill));
};
} else if (step.trigger === 'drag') {
step.triggers = function (callback) {
self.onSnippetDragged(callback || self.moveToNextStep);