diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-02-01 16:40:13 +0100 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-02-01 16:40:13 +0100 |
| commit | 920aa6174c938bbfc0864a95ff3d8ebbe3132387 (patch) | |
| tree | a1bd8f8871cba6af086607d94842a4f5e53fbbbe /addons/web_editor/static/src | |
| parent | eeebd4ad857fec39c14abc0a0e387c13adcfa30b (diff) | |
| parent | e0422bfd6c528313ee399dad3e67407360d49725 (diff) | |
[MERGE] forward port branch saas-15 up to e0422bfd6c5
Diffstat (limited to 'addons/web_editor/static/src')
| -rw-r--r-- | addons/web_editor/static/src/js/backend.js | 12 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 8 |
2 files changed, 20 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/backend.js b/addons/web_editor/static/src/js/backend.js index 03f72253b22..ad6d2c68186 100644 --- a/addons/web_editor/static/src/js/backend.js +++ b/addons/web_editor/static/src/js/backend.js @@ -401,7 +401,19 @@ var FieldTextHtml = AbstractField.extend({ var layoutInfo = self.editor.rte.editable().data('layoutInfo'); $.summernote.pluginEvents.codeview(undefined, undefined, layoutInfo, false); } + var $ancestors = self.$iframe.filter(':not(:visible)').parentsUntil(':visible').addBack(); + var ancestorsStyle = []; + // temporarily force displaying iframe (needed for firefox) + _.each($ancestors, function (el) { + var $el = $(el); + ancestorsStyle.unshift($el.attr('style') || null); + $el.css({display: 'initial', visibility: 'hidden', height: 1}); + }); self.editor.buildingBlock.clean_for_save(); + _.each($ancestors, function (el) { + var $el = $(el); + $el.attr('style', ancestorsStyle.pop()); + }); self._setValue(self.$content.html()); }); }, diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index a3e3db42a71..8166d77201e 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -2018,6 +2018,14 @@ eventHandler.modules.editor.currentStyle = function (target) { if(r) styleInfo.image = r.isOnImg(); } + // Fix when the target is a link: the text-align buttons state should + // indicate the alignment of the link in the parent, not the text inside + // the link (which is not possible to customize with summernote). Summernote fixed + // this in their newest version... by just not showing the active button + // for alignments. + if (styleInfo.anchor) { + styleInfo['text-align'] = $(styleInfo.anchor).parent().css('text-align'); + } return styleInfo; } |
