diff --git a/addons/web_editor/static/src/js/editor/rte.js b/addons/web_editor/static/src/js/editor/rte.js index 4d2f6fe977a..c0e2218d974 100644 --- a/addons/web_editor/static/src/js/editor/rte.js +++ b/addons/web_editor/static/src/js/editor/rte.js @@ -654,7 +654,7 @@ var RTEWidget = Widget.extend({ // 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) { + if ($.browser.chrome === true && ev.originalEvent.detail === 3) { var currentSelection = range.create(); if (currentSelection.sc.parentNode === currentSelection.ec) { _selectSC(currentSelection); @@ -671,17 +671,6 @@ var RTEWidget = Widget.extend({ function _selectSC(selection) { range.create(selection.sc, selection.so, selection.sc, selection.sc.length).select(); } - - // 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 && ev.originalEvent.detail === 3) { - var currentSelection = range.create(); - if (currentSelection.sc.parentNode === currentSelection.ec) { - range.create(currentSelection.sc, currentSelection.so, currentSelection.sc, currentSelection.sc.length).select(); - } - } }, });