From db9b7bc8256b17ea1adda3b832d7654abccc00df Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 14 Jan 2015 14:06:23 +0100 Subject: [PATCH] [FIX] website: Selector for the image and table-handlers are still there even if we've deleted the snippet --- .../website/static/src/js/website.snippets.editor.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 068893492bd..a1e010a3bcd 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -1944,16 +1944,19 @@ } }, - on_clone: function () { + on_clone: function (event) { + event.preventDefault(); var $clone = this.$target.clone(false); this.$target.after($clone); for (var i in this.styles){ this.styles[i].on_clone($clone); } + this.BuildingBlock.create_overlay(this.$target); return false; }, - on_remove: function () { + on_remove: function (event) { + event.preventDefault(); this.on_blur(); this.BuildingBlock.parent.rte.historyRecordUndo(this.$target); @@ -1977,6 +1980,10 @@ } } + // clean editor if they are image or table in deleted content + $(".note-control-selection").hide(); + $('.o_table_handler').remove(); + return false; },