summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/snippets.editor.js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-09-22 15:23:45 +0200
committerChristophe Simonis <chs@odoo.com>2016-09-22 15:23:45 +0200
commit856476d4418390ca89ef161e31faf61248eeaa1d (patch)
treef87ab29316440a28e9032d1b811eeb7ea5155653 /addons/web_editor/static/src/js/snippets.editor.js
parent4b812d9965128b02b4ac5ea49a66da622953cddc (diff)
parentb1b700adb1f26bb43e8f4b77b85f969a4b52d36c (diff)
[MERGE] forward port branch saas-12 up to b1b700a
Diffstat (limited to 'addons/web_editor/static/src/js/snippets.editor.js')
-rw-r--r--addons/web_editor/static/src/js/snippets.editor.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/web_editor/static/src/js/snippets.editor.js b/addons/web_editor/static/src/js/snippets.editor.js
index f20b693c458..dcfabb6feb4 100644
--- a/addons/web_editor/static/src/js/snippets.editor.js
+++ b/addons/web_editor/static/src/js/snippets.editor.js
@@ -1001,10 +1001,12 @@ data.Editor = Class.extend({
},
on_remove: function (event) {
- event.preventDefault();
- this.on_blur();
+ if (event !== undefined) {
+ event.preventDefault();
+ this.buildingBlock.getParent().rte.historyRecordUndo(this.$target);
+ }
- this.buildingBlock.getParent().rte.historyRecordUndo(this.$target);
+ this.on_blur();
var index = _.indexOf(this.buildingBlock.snippets, this.$target.get(0));
this.buildingBlock.call_for_all_snippets(this.$target, function (editor, $snippet) {
@@ -1037,7 +1039,7 @@ data.Editor = Class.extend({
}
if ($parent.children().length === 0 && $parent.text().trim() === "") {
_.defer(function () {
- $parent.data("snippet-editor").on_remove(event);
+ $parent.data("snippet-editor").on_remove();
});
}
}