summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2017-10-18 16:57:35 +0200
committerChristophe Simonis <chs@odoo.com>2017-10-18 16:57:35 +0200
commit25e65d2bcb18f8a39a288176ee28ac0cc1540050 (patch)
tree0e7f68faa4e89aebc2d5f595e4bcae98d6f7f5d0 /addons/web_editor/static/src
parentd365a289d4ed3f557fa46155419f5f517860fe9c (diff)
parent8096162beeed30debcb1c3945e7f9cee35710666 (diff)
[MERGE] forward port branch saas-15 up to 8096162beee
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/rte.js22
-rw-r--r--addons/web_editor/static/src/less/web_editor.common.less4
2 files changed, 25 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/rte.js b/addons/web_editor/static/src/js/rte.js
index db26a7ccfae..f2fb2753642 100644
--- a/addons/web_editor/static/src/js/rte.js
+++ b/addons/web_editor/static/src/js/rte.js
@@ -578,6 +578,28 @@ var RTE = Widget.extend({
_.defer(function () {
self.historyRecordUndo($target, 'activate', true);
});
+
+ // To Fix Google Chrome Tripleclick Issue, which selects the ending
+ // whitespace characters (so Tripleclicking then typing text will remove
+ // the whole paragraph instead of its content).
+ // http://stackoverflow.com/questions/38467334/why-does-google-chrome-always-add-space-after-selected-text
+ if ($.browser.chrome === true && event.originalEvent.detail === 3) {
+ var currentSelection = range.create();
+ if (currentSelection.sc.parentNode === currentSelection.ec) {
+ _selectSC(currentSelection);
+ } else if (currentSelection.eo === 0) {
+ var $hasNext = $(currentSelection.sc).parent();
+ while (!$hasNext.next().length && !$hasNext.is('body')) {
+ $hasNext = $hasNext.parent();
+ }
+ if ($hasNext.next()[0] === currentSelection.ec) {
+ _selectSC(currentSelection);
+ }
+ }
+ }
+ function _selectSC(selection) {
+ range.create(selection.sc, selection.so, selection.sc, selection.sc.length).select();
+ }
},
editable: function () {
diff --git a/addons/web_editor/static/src/less/web_editor.common.less b/addons/web_editor/static/src/less/web_editor.common.less
index c48fdf7df46..973b04dbf2d 100644
--- a/addons/web_editor/static/src/less/web_editor.common.less
+++ b/addons/web_editor/static/src/less/web_editor.common.less
@@ -23,7 +23,9 @@ html, body {
/* ----- GENERIC LAYOUTING HELPERS ---- */
/* table */
#wrapwrap, .o_editable {
- table.table {
+ // Only style editor-made tables (shop/portal/... tables are not supposed to
+ // use table-bordered...)
+ table.table.table-bordered {
table-layout: fixed;
td {
min-width: 20px;