[IMP] website editor: better rendering of the popover when failure write raise by...
[odoo/odoo.git] / addons / website / static / src / js / website.tour.install-app.js
1 (function () {
2     'use strict';
3
4     var website = openerp.website;
5
6     var render = website.tour.render;
7
8     website.InstallAppTour = website.EditorTour.extend({
9         id: 'install-app',
10         name: "Install a new App",
11         init: function (editor) {
12             var self = this;
13             var $body = $(document.body);
14             self.steps = [
15                 {
16                     stepId: 'welcome-install-app',
17                     orphan: true,
18                     backdrop: true,
19                     title: "Install an App",
20                     content: "You can intall some apps to manage your website content.",
21                     template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
22                 },
23                 {
24                     stepId: 'customize',
25                     element: '#customize-menu-button',
26                     placement: 'left',
27                     title: "Install an app",
28                     content: "Add new apps by customizing your website.",
29                     template: render('website.tour_popover'),
30                     onShow: function () {
31                         editor.on('rte:customize_menu_ready', editor, function () {
32                             self.movetoStep('install-app');
33                         });
34                     },
35                 },
36                 {
37                     stepId: 'install-app',
38                     element: '#customize-menu li:last a',
39                     placement: 'left',
40                     orphan: true,
41                     title: "Install an app",
42                     content: "Click 'Install Apps' to select and install the application you would like to manage from your website.",
43                     template: render('website.tour_popover'),
44                 },
45             ];
46             return this._super();
47         },
48     });
49
50     website.EditorBar.include({
51         start: function () {
52             this.registerTour(new website.InstallAppTour(this));
53             return this._super();
54         },
55     });
56
57 }());