[MERGE] forward port branch saas-12.4 up to cda4f3c308

This commit is contained in:
Christophe Simonis
2019-07-29 14:10:30 +02:00
251 changed files with 3175 additions and 1364 deletions
@@ -19,6 +19,12 @@ var HistoryPlugin = Plugins.history.extend({
console.error(e);
}
this.context.invoke('editor.focus');
var newRange = this.context.invoke('editor.createRange');
if (!this.options.isEditableNode(newRange.sc)) {
var firstEditableSel = '[contenteditable="true"]:not(":hidden")';
var sc = this.$editable.find(firstEditableSel)[0];
this.context.invoke('editor.setRange', sc, 0, sc, 0).select();
}
},
/**
* Clear the history.
@@ -358,6 +358,8 @@ var SnippetEditor = Widget.extend({
ev.preventDefault();
this.trigger_up('cover_will_change');
this.trigger_up('snippet_will_be_cloned', {$target: this.$target});
var $clone = this.$target.clone(false);
this.trigger_up('request_history_undo_record', {$target: this.$target});
@@ -372,7 +374,7 @@ var SnippetEditor = Widget.extend({
}
},
});
this.trigger_up('snippet_cloned', {$target: $clone});
this.trigger_up('snippet_cloned', {$target: $clone, $origin: this.$target});
$clone.trigger('content_changed');
},
/**