From e634a52cace081edfce324f14228ddb419af0a31 Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 15 Sep 2016 16:33:19 +0200 Subject: [PATCH] [FIX] web_editor: mark snippets which can't be dropped in the page The system was lost with the editor refactoring which came with saas-10 and commit bf39884a5c95c3f69e94d65e10a4d4eda3726649. Indeed the show() method of the BuildingBlock class was removed as the widget is now always showed but the show_blocks() method it called was not removed (and thus was not called anymore). As a fix, the show_blocks method is now called again, on snippets initializations and each time a snippet is dropped or removed. --- addons/web_editor/static/src/js/snippets.editor.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js index cd03cb70f6a..51cc5a31615 100644 --- a/addons/web_editor/static/src/js/snippets.editor.js +++ b/addons/web_editor/static/src/js/snippets.editor.js @@ -356,6 +356,9 @@ var BuildingBlock = Widget.extend({ }); self.make_snippet_draggable(self.$snippets); + + this.show_blocks(); + this.$el.on("snippet-dropped snippet-removed", this.show_blocks.bind(this)); }, cover_target: function ($el, $target) { @@ -1074,6 +1077,8 @@ var Editor = Class.extend({ $(".note-control-selection").hide(); $('.o_table_handler').remove(); + this.buildingBlock.$el.trigger("snippet-removed"); + return false; },