diff options
| author | Christophe Simonis <chs@odoo.com> | 2015-07-22 16:17:54 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2015-07-22 16:17:54 +0200 |
| commit | 2cf91d16a5f844a2a3d5d22c025c180a6615bab8 (patch) | |
| tree | a7bc3974a9c349ae1575fd3b10bbb25d9b74b9ab /addons/web_editor/static/src/js/summernote.js | |
| parent | d74e0c3e9d9cd80bf532ba90f7c634ff55881b51 (diff) | |
| parent | 63e92cbc9621813a276e340b7d961cbd8f8b97c4 (diff) | |
[MERGE] forward port of branch saas-6 up to 63e92cb
Diffstat (limited to 'addons/web_editor/static/src/js/summernote.js')
| -rw-r--r-- | addons/web_editor/static/src/js/summernote.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/summernote.js b/addons/web_editor/static/src/js/summernote.js index b144ae4eacc..46b21aeec88 100644 --- a/addons/web_editor/static/src/js/summernote.js +++ b/addons/web_editor/static/src/js/summernote.js @@ -1776,7 +1776,7 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color var startPoint = rng.getStartPoint(); var endPoint = rng.getEndPoint(); - if (rng.isCollapsed()) { + if (rng.isCollapsed() && !dom.isFont(rng.sc)) { return { sc: startPoint.node, so: startPoint.offset, @@ -1824,6 +1824,11 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color }); nodes = list.unique(nodes); + // If ico fa + if (rng.isCollapsed()) { + nodes.push(startPoint.node); + } + // apply font: foreColor, backColor, size (the color can be use a class text-... or bg-...) var node, font, $font, fonts = [], className; if (color || bgcolor || size) { @@ -1847,7 +1852,7 @@ $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color if (color) { for (var k=0; k<className.length; k++) { - if (!className[k].length && className[k].slice(0,5) === "text-") { + if (className[k].length && className[k].slice(0,5) === "text-") { className.splice(k,1); k--; } |
