[FIX] website snippet: reset snippet-editor and overlay because the rte re-generate the dom and cancelled all snippet datas

bzr revid: chm@openerp.com-20140207100734-pdzr0qz8mtmha96m
This commit is contained in:
Christophe Matthieu 2014-02-07 11:07:34 +01:00
parent 4b22c30888
commit 8879fb1728
1 changed files with 13 additions and 0 deletions

View File

@ -416,6 +416,19 @@
}
setTimeout(function () {
$("#oe_snippets").trigger('snippet-dropped', $target);
// reset snippet for rte
$target.removeData("snippet-editor");
$target.removeData("overlay");
self.create_overlay($target);
$target.find("[data-snippet-id]").each(function () {
var $snippet = $(this);
$snippet.removeData("snippet-editor");
$snippet.removeData("overlay");
self.create_overlay($snippet);
});
// end
self.make_active($target);
},0);
} else {