[FIX] Fixed product tour

bzr revid: ddm@openerp.com-20131125154953-9vyfdtrnmws6qm32
This commit is contained in:
ddm 2013-11-25 16:49:53 +01:00
parent 4e3f0a5a9b
commit 1a0b6a55e5
4 changed files with 62 additions and 8 deletions

View File

@ -92,21 +92,18 @@
},
onSnippetDraggedAdvance: function (snippetId, stepId) {
var self = this;
var $body = $(document.body);
var $snippetIcon = $('#website-top-navbar [data-snippet-id='+snippetId+'].ui-draggable');
function beginDrag () {
$('.popover.tour').remove();
function advance () {
$('#snippets').toggle();
if (stepId) {
self.moveToStep(stepId);
} else {
self.moveToNextStep()
}
}
$body.one('mouseup', advance);
$(document.body).one('mouseup', advance);
}
$snippetIcon.one('mousedown', beginDrag);
$('#website-top-navbar [data-snippet-id='+snippetId+'].ui-draggable').one('mousedown', beginDrag);
},
});

View File

@ -88,7 +88,7 @@
template: self.popover({ next: "OK" }),
},
{
stepId: 'add-image-block',
stepId: 'add-image-text',
element: 'button[data-action=snippet]',
placement: 'bottom',
title: "Layout your blog post",

View File

@ -63,11 +63,52 @@
template: self.popover({ next: "OK" }),
},
{
stepId: 'add-block',
stepId: 'edit-page',
element: 'button[data-action=edit]',
placement: 'bottom',
title: "Edit the event desciption",
content: "Edit the page to modify the event description.",
triggers: function () {
editor.on('tour:editor_bar_loaded', self, self.moveToNextStep);
},
},
{
stepId: 'add-image-text',
element: 'button[data-action=snippet]',
placement: 'bottom',
title: "Layout your event",
content: "Insert blocks like text-image to layout the body of your event.",
triggers: function () {
$('button[data-action=snippet]').one('click', function () {
self.moveToNextStep();
});
},
},
{
stepId: 'drag-image-text',
element: '#website-top-navbar [data-snippet-id=text-block].ui-draggable',
placement: 'bottom',
title: "Drag & Drop a block",
content: "Drag the 'Text Block' block and drop it in your page.",
triggers: function () {
self.onSnippetDraggedAdvance('text-block');
},
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your event",
content: "Click to publish your event.",
},
{
stepId: 'save-changes',
element: 'button[data-action=save]',
placement: 'right',
reflex: true,
title: "Save your modifications",
content: "Once you click on save, your event is updated.",
},
];
return this._super();
@ -76,7 +117,7 @@
return this.isCurrentStep('event-page') && !this.tour.ended();
},
trigger: function () {
return (this.resume() && this.testUrl(/^\/event\/[0-9]+\/\?enable_editor=1/)) || this._super();
return (this.resume() && this.testUrl(/^\/event\/register\/[0-9]+/)) || this._super();
},
});

View File

@ -93,6 +93,22 @@
self.onSnippetDraggedAdvance('big-picture');
},
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your product",
content: "Click to publish your product so your customers can see it.",
},
{
stepId: 'save-changes',
element: 'button[data-action=save]',
placement: 'right',
reflex: true,
title: "Save your modifications",
content: "Once you click on save, your product is updated.",
},
];
return this._super();
},