From e0d33ad3c56cf627a0dc0d86f689fd4ec1eb3519 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Mon, 31 Mar 2014 15:33:40 +0200 Subject: [PATCH] [FIX] website editor: shop tour and media editor for field image bzr revid: chm@openerp.com-20140331133340-vj67s9hlptum0h19 --- .../website/static/src/js/website.editor.js | 4 +++ .../static/src/js/website.snippets.editor.js | 9 ++++++ .../static/src/js/website.tour.shop.js | 30 +++++-------------- 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index ffbc5ee41e8..2de0e92b8db 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1366,6 +1366,10 @@ this.$('[href="#editor-media-icon"]').tab('show'); } + if ($(this.media.$).parent().data("oe-field") === "image") { + this.$('[href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden'); + } + return this._super(); }, save: function () { diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 59e624ce435..0febdb2bedd 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1494,6 +1494,15 @@ new website.editor.MediaDialog(self, self.element).appendTo(document.body); }); }, + onFocus : function () { + var self = this; + if (this.$target.parent().data("oe-field") === "image") { + this.$overlay.addClass("hidden"); + self.element = new CKEDITOR.dom.element(self.$target[0]); + new website.editor.MediaDialog(self, self.element).appendTo(document.body); + self.BuildingBlock.make_active(false); + } + }, }); diff --git a/addons/website_sale/static/src/js/website.tour.shop.js b/addons/website_sale/static/src/js/website.tour.shop.js index adb4a9e556c..6291f2fc54e 100644 --- a/addons/website_sale/static/src/js/website.tour.shop.js +++ b/addons/website_sale/static/src/js/website.tour.shop.js @@ -66,39 +66,23 @@ }, { waitNot: '.product_price .oe_currency_value:containsExact(1.00)', - element: '#wrap img.img:first', + element: '#wrap img.product_detail_img', placement: 'top', title: _t("Update image"), content: _t("Click here to set an image describing your product."), }, { - element: 'button.hover-edition-button:visible', + element: 'img[alt=ipad]', placement: 'top', - title: _t("Update image"), - content: _t("Click here to set an image describing your product."), - }, - { - wait: 500, - element: '.well a.pull-right', - placement: 'bottom', title: _t("Select an Image"), - content: _t("Let's select an existing image."), - popover: { fixed: true }, + content: _t("Let's select an ipad image."), }, { - element: 'img[alt=imac]', - placement: 'bottom', - title: _t("Select an Image"), - content: _t("Let's select an imac image."), - popover: { fixed: true }, - }, - { - waitNot: 'img[alt=imac]', + waitFor: '.media_selected img[alt=ipad]', element: '.modal-content button.save', - placement: 'bottom', - title: _t("Select this Image"), - content: _t("Click to add the image to the product decsription."), - popover: { fixed: true }, + placement: 'top', + title: _t("Save this Image"), + content: _t("Click on save to add the image to the product decsription."), }, { waitNot: '.modal-content:visible',