From 1e9df02682d84a4d9e012c18c4abdcf083b92a08 Mon Sep 17 00:00:00 2001 From: ddm Date: Fri, 8 Nov 2013 15:38:48 +0100 Subject: [PATCH] [FIX] tour has been fixed bzr revid: ddm@openerp.com-20131108143848-eg0xulyeggjs4tts --- .../website/static/src/js/website.snippets.js | 21 ++++++++++--------- .../static/src/js/website.tour.basic.js | 11 +++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.js b/addons/website/static/src/js/website.snippets.js index 6a9c4039e97..8032d688a82 100644 --- a/addons/website/static/src/js/website.snippets.js +++ b/addons/website/static/src/js/website.snippets.js @@ -22,8 +22,9 @@ window.snippets = this.snippets = new website.snippet.BuildingBlock(this); this.snippets.appendTo(this.$el); - this.rte.on('rte:ready', this, function () { + this.on('rte:ready', this, function () { self.snippets.$button.removeClass("hidden"); + self.trigger('rte:snippets_ready'); }); return this._super.apply(this, arguments); @@ -52,7 +53,7 @@ }); /* ----- SNIPPET SELECTOR ---- */ - + website.snippet = {}; var observer = new website.Observer(function (mutations) { if (!_(mutations).find(function (m) { @@ -504,7 +505,7 @@ console.debug( "A good node must have a [data-oe-model] attribute or must have at least one parent with [data-oe-model] attribute."); console.debug( "Wrong node(s): ", selector); } - + function is_visible($el){ return $el.css('display') != 'none' && $el.css('opacity') != '0' @@ -519,7 +520,7 @@ var parents = $(this).parents().filter(function(){ return !is_visible($(this)); }); return parents.length === 0; }); - + $targets.each(function () { var $target = $(this); if (!$target.data('overlay')) { @@ -558,13 +559,13 @@ start: function () { }, /* onFocusEdit - * if they are an editor for this data-snippet-id + * if they are an editor for this data-snippet-id * Called before onFocus of snippet editor */ onFocusEdit : function () {}, /* onBlurEdit - * if they are an editor for this data-snippet-id + * if they are an editor for this data-snippet-id * Called after onBlur of snippet editor */ onBlurEdit : function () {}, @@ -665,7 +666,7 @@ }); $("body").addClass('move-important'); - + self._drag_and_drop_after_insert_dropzone(); self._drag_and_drop_active_drop_zone($('.oe_drop_zone')); }, @@ -855,7 +856,7 @@ if (!resize_values.s) $box.find(".oe_handle.s").remove(); if (!resize_values.e) $box.find(".oe_handle.e").remove(); if (!resize_values.w) $box.find(".oe_handle.w").remove(); - + this.$overlay.append($box.find(".oe_handles").html()); this.$overlay.find(".oe_handle").on('mousedown', function (event){ @@ -1111,7 +1112,7 @@ var index = $active.index(); this.$target.find('.carousel-control, .carousel-indicators').removeClass("hidden"); this.$indicators.append('
  • '); - + var $clone = this.$el.find(".item.active").clone(); var bg = this.$editor.find('ul[name="carousel-background"] li:not([data-value="'+ $active.css("background-image").replace(/.*:\/\/[^\/]+|\)$/g, '') +'"]):first').data("value"); $clone.css("background-image", "url('"+ bg +"')"); @@ -1216,7 +1217,7 @@ var $li = $ul.find("li"); var $parallax = this.$target.find('.parallax'); var speed = $parallax.data('stellar-background-ratio') || 0.5 ; - + $ul.find('[data-value="' + speed + '"]').addClass('active'); $li.on('click', function (event) { $li.removeClass("active"); diff --git a/addons/website/static/src/js/website.tour.basic.js b/addons/website/static/src/js/website.tour.basic.js index 876d2a7b5b9..649317b8cfc 100644 --- a/addons/website/static/src/js/website.tour.basic.js +++ b/addons/website/static/src/js/website.tour.basic.js @@ -24,10 +24,14 @@ stepId: 'edit-page', element: 'button[data-action=edit]', placement: 'bottom', - reflex: true, title: "Edit this page", content: "Every page of your website can be modified through the Edit button.", template: render('website.tour_popover'), + onShow: function () { + editor.on('rte:snippets_ready', editor, function() { + self.movetoStep('add-block'); + }); + }, }, { stepId: 'add-block', @@ -37,11 +41,6 @@ content: "To add content in a page, you can insert building blocks.", template: render('website.tour_popover'), onShow: function () { - function refreshAddBlockStep () { - self.tour.showStep(self.indexOfStep('add-block')); - editor.off('rte:ready', editor, refreshAddBlockStep); - } - editor.on('rte:ready', editor, refreshAddBlockStep); $('button[data-action=snippet]').click(function () { self.movetoStep('drag-banner'); });