[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 bf39884a5c.
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.
This commit is contained in:
@@ -356,6 +356,9 @@ var BuildingBlock = Widget.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.make_snippet_draggable(self.$snippets);
|
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) {
|
cover_target: function ($el, $target) {
|
||||||
@@ -1074,6 +1077,8 @@ var Editor = Class.extend({
|
|||||||
$(".note-control-selection").hide();
|
$(".note-control-selection").hide();
|
||||||
$('.o_table_handler').remove();
|
$('.o_table_handler').remove();
|
||||||
|
|
||||||
|
this.buildingBlock.$el.trigger("snippet-removed");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user