From 7b2e857c2f69d2887f69ef780103255a30ed14cf Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Tue, 30 Aug 2016 15:48:30 +0200 Subject: [FIX] website: promote: very slow title edition when use keywords --- addons/website/static/src/js/website.seo.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.seo.js b/addons/website/static/src/js/website.seo.js index c8a2317af25..4315f90618b 100644 --- a/addons/website/static/src/js/website.seo.js +++ b/addons/website/static/src/js/website.seo.js @@ -343,8 +343,8 @@ var Configurator = Widget.extend({ template: 'website.seo_configuration', events: { 'keyup input[name=seo_page_keywords]': 'confirmKeyword', - 'keyup input[name=seo_page_title]': 'titleChanged', - 'keyup textarea[name=seo_page_description]': 'descriptionChanged', + 'blur input[name=seo_page_title]': 'titleChanged', + 'blur textarea[name=seo_page_description]': 'descriptionChanged', 'click button[data-action=add]': 'addKeyword', 'click button[data-action=update]': 'update', 'hidden.bs.modal': 'destroy', -- cgit v1.2.3 From c952e1fc55e6b2dfae948a92f191fba9537519d5 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 27 Sep 2016 12:09:20 +0200 Subject: [FIX] website_sale: fix shop list view publish buttons Publish buttons appeared in list view item in /shop with commit 5a5dd1e100bb2e5bc2a6e215a963322bbfbe98b1. They however never worked for some reasons: * The publish buttons were unclickable as the around style was badly implemented: the section title was over the publish button * Even if it was clickable, the publish button handler had no prevent default, thus it submitted the form it is in -> crash when no cart button or added to cart on click on publish button if there was a cart button... Note: the style should be reviewed in next versions, this commit, as a 9.0 fix, fixes the style with the minimum code and so that it does not break any theme. --- addons/website/static/src/js/website.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 7c2ad6cc48c..4e5b805fa8c 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -186,9 +186,10 @@ base.ready().then(function () { */ /* ----- PUBLISHING STUFF ---- */ - $(document).on('click', '.js_publish_management .js_publish_btn', function () { + $(document).on('click', '.js_publish_management .js_publish_btn', function (e) { + e.preventDefault(); + var $data = $(this).parents(".js_publish_management:first"); - var self=this; ajax.jsonRpc($data.data('controller') || '/website/publish', 'call', {'id': +$data.data('id'), 'object': $data.data('object')}) .then(function (result) { $data.toggleClass("css_unpublished css_published"); -- cgit v1.2.3 From 5f98040430ab0ce750382cc0faf57146f8759752 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Tue, 27 Sep 2016 15:30:08 +0200 Subject: [FIX] website, *: properly process saving from editor dialogs * web_editor, website_blog Since recent refactoring, web editor dialogs automatically trigger an event when closed (saved or cancel). The problem is that there still was manual trigger of those events or variants ("save" instead of "saved"). To prevent multi-saving and be consistent, all save events are now automatically triggered on save/close (no more manual) and the event name is "save". --- addons/website/static/src/js/website.contentMenu.js | 4 ++-- addons/website/static/src/js/website.snippets.gallery.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.contentMenu.js b/addons/website/static/src/js/website.contentMenu.js index e01ec55eb24..d91007a7491 100644 --- a/addons/website/static/src/js/website.contentMenu.js +++ b/addons/website/static/src/js/website.contentMenu.js @@ -180,8 +180,8 @@ var SelectEditMenuDialog = widget.Dialog.extend({ }, options || {})); }, save: function () { - this.trigger("save", parseInt(this.$el.find("select").val() || null)); - this._super(); + this.final_data = parseInt(this.$el.find("select").val() || null); + this._super.apply(this, arguments); } }); diff --git a/addons/website/static/src/js/website.snippets.gallery.js b/addons/website/static/src/js/website.snippets.gallery.js index 481ba06e6f3..cde906ca764 100644 --- a/addons/website/static/src/js/website.snippets.gallery.js +++ b/addons/website/static/src/js/website.snippets.gallery.js @@ -67,7 +67,7 @@ options.registry.gallery = options.Class.extend({ }, bind_change: function () { var self = this; - return this.$target.find("img").off('saved').on('saved', function (event, img) { + return this.$target.find("img").off('save').on('save', function (event, img) { var $parent = $(img).parent(); $parent.addClass("saved_active"); var index = self.$target.find(".item.saved_active").index(); @@ -228,7 +228,7 @@ options.registry.gallery = options.Class.extend({ var $container = this.$target.find(".container:first"); var editor = new widget.MediaDialog(null, {select_images: true}, this.$target.closest('.o_editable'), null).open(); var index = Math.max(0, _.max(_.map(this.$target.find("img").get(), function (img) { return img.dataset.index | 0; })) + 1); - editor.on('saved', this, function (attachments) { + editor.on('save', this, function (attachments) { for (var i = 0 ; i < attachments.length; i++) { $('') .attr("src", attachments[i].src) -- cgit v1.2.3