summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2016-11-15 13:58:55 +0100
committerChristophe Simonis <chs@odoo.com>2016-11-15 13:58:55 +0100
commitdece72d010e23c88bdf5b2a1ace6ff0df2b2732f (patch)
treef9fc12d1f2f5f51acca168854702f75e316e1f0b /addons/web_editor/static/src/js
parent22d7be5b7397f9d9a811e071601a9ad07762dc55 (diff)
parentca2003839a9abc3f76f48d2382d512a4546aeab1 (diff)
[MERGE] forward port branch saas-12 up to ca20038
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/summernote.js17
-rw-r--r--addons/web_editor/static/src/js/widgets.js6
2 files changed, 15 insertions, 8 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js
index 28bfe83a345..5c344fbbcd1 100644
--- a/addons/web_editor/static/src/js/summernote.js
+++ b/addons/web_editor/static/src/js/summernote.js
@@ -938,12 +938,19 @@ $.summernote.pluginEvents.insertTable = function (event, editor, layoutInfo, sDi
var dimension = sDim.split('x');
var r = range.create();
if (!r) return;
- r = r.deleteContents();
+ r = r.deleteContents(true);
- var isBodyContainer = dom.isBodyContainer;
- dom.isBodyContainer = dom.isNotBreakable;
- r.insertNode(editor.table.createTable(dimension[0], dimension[1]));
- dom.isBodyContainer = isBodyContainer;
+ var table = editor.table.createTable(dimension[0], dimension[1]);
+ var parent = r.sc;
+ while (dom.isText(parent.parentNode) || dom.isRemovableEmptyNode(parent.parentNode)) {
+ parent = parent.parentNode;
+ }
+ var node = dom.splitTree(parent, {'node': r.sc, 'offset': r.so}) || r.sc;
+ node.parentNode.insertBefore(table, node);
+
+ if ($(node).text() === '' || node.textContent === '\u00A0') {
+ node.parentNode.removeChild(node);
+ }
editor.afterCommand($editable);
event.preventDefault();
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index 61ec1564ac5..d3ad1e6fbc8 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -812,7 +812,7 @@ function createVideoNode(url, options) {
class: 'vine-embed'
});
} else if (vimMatch && vimMatch[3].length) {
- $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>', {
+ $video = $('<iframe>', {
src: '//player.vimeo.com/video/' + vimMatch[3],
width: '640',
height: '360'
@@ -824,14 +824,14 @@ function createVideoNode(url, options) {
height: '360'
});
} else if (youkuMatch && youkuMatch[1].length) {
- $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>', {
+ $video = $('<iframe>', {
height: '498',
width: '510',
src: '//player.youku.com/embed/' + youkuMatch[1]
});
} else {
// this is not a known video link. Now what, Cat? Now what?
- $video = $('<iframe webkitallowfullscreen mozallowfullscreen allowfullscreen>', {
+ $video = $('<iframe>', {
width: '640',
height: '360',
src: url