summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-09-11 11:45:44 +0200
committerChristophe Simonis <chs@odoo.com>2017-09-11 11:45:44 +0200
commit48f88992da66a12eb0653a8a69b7d4e0e9389d9e (patch)
treeb041dc44e6c7cf9a5168d4bf9ebc59c0205ca26c /addons/web_editor/static/src
parent4e2db85f2e10cfd53abb7c1e27d4ca4986ae89c9 (diff)
parent7d7e94c6ef4257dc0c2a7fed7bd7d40ed914a50a (diff)
[MERGE] forward port branch 10.0 up to 7d7e94c6ef4
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/summernote.js5
-rw-r--r--addons/web_editor/static/src/js/widgets.js2
2 files changed, 5 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index 71647828cc6..d28279d57ed 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -504,7 +504,7 @@ dom.removeBetween = function (sc, so, ec, eo, towrite) {
};
for (var i=0; i<nodes.length; i++) {
- if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after)) {
+ if (!dom.ancestor(nodes[i], ancestor_first_last) && !$.contains(nodes[i], before) && !$.contains(nodes[i], after) && !dom.isEditable(nodes[i])) {
nodes[i].parentNode.removeChild(nodes[i]);
}
}
@@ -1121,6 +1121,9 @@ $.summernote.pluginEvents.enter = function (event, editor, layoutInfo) {
// double enter on the end of a blockquote & pre = new line out of the list
$('<p></p>').append(br).insertAfter($(r.sc).closest('blockquote, pre'));
node = br;
+ } else if (dom.isEditable(dom.node(r.sc))) {
+ // if we are directly in an editable, only SHIFT + ENTER should add a newline
+ node = null;
} else if (last === r.sc) {
if (dom.isBR(last)) {
last = last.parentNode;
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index 6e7a6784351..eb34bd152ca 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -915,7 +915,7 @@ var VideoDialog = Widget.extend({
video_id = this.$("#video_id").val();
}
var $iframe = $(
- '<div class="media_iframe_video" data-src="'+this.$iframe.attr("src")+'">'+
+ '<div class="media_iframe_video" data-oe-expression="'+this.$iframe.attr("src")+'">'+
'<div class="css_editable_mode_display">&nbsp;</div>'+
'<div class="media_iframe_video_size" contentEditable="false">&nbsp;</div>'+
'<iframe src="'+this.$iframe.attr("src")+'" frameborder="0" allowfullscreen="allowfullscreen" contentEditable="false"></iframe>'+