diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-06-14 17:29:56 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-06-14 17:29:56 +0200 |
| commit | 23a1bce2a9c3a7a9cbfbb4c554ebacb337d9470e (patch) | |
| tree | a547ed9fafa293d2500f079aa91c045c22a8f396 /addons/web_editor/static/src/js/widgets.js | |
| parent | 84acd427b8adc6f2c3dc3767ca8ee8f99e4ccbd7 (diff) | |
| parent | 90165e2d96ac27dd1dbb2e367d47b8a38b7aea40 (diff) | |
[MERGE] forward port branch 9.0 up to 90165e2d96a
Diffstat (limited to 'addons/web_editor/static/src/js/widgets.js')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js index 005d085fec8..dc347c61690 100644 --- a/addons/web_editor/static/src/js/widgets.js +++ b/addons/web_editor/static/src/js/widgets.js @@ -320,8 +320,7 @@ var ImageDialog = Widget.extend({ var img = this.images[0]; if (!img) { - var id = this.$(".existing-attachments [data-src]:first").data('id'); - img = _.find(this.images, function (img) { return img.id === id;}); + return this.media; } var media; @@ -1023,6 +1022,8 @@ var LinkDialog = Dialog.extend({ if (dom.ancestor(nodes[i], dom.isImg)) { this.data.images.push(dom.ancestor(nodes[i], dom.isImg)); text += '[IMG]'; + } else if (!is_link && nodes[i].nodeType === 1) { + // just use text nodes from listBetween } else if (!is_link && i===0) { text += nodes[i].textContent.slice(so, Infinity); } else if (!is_link && i===nodes.length-1) { |
