summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJason Van Malder <jvm@odoo.com>2019-12-30 11:00:31 +0000
committerJason Van Malder <jvm@odoo.com>2020-01-06 13:11:10 +0000
commitabc6dbdc765ac36a98d0e07efba62379ddf7e26b (patch)
treeae4318c10db05c9ca7fce73c4b34ca4cb075db5a /addons
parent76723b98c1fe11380be8b10f833b74c021f2e5ab (diff)
[FIX] web_editor: fix summernote text drop on firefox
Issue - Have firefox - Go to any chatter - Open full editor - Write some "test" words with line breaks - Select one of your "test" words - Drag & drop it somewhere else in the editor Welcome on test.com! (redirected) Cause Summernote doesn't preventDefault on drop event, so firefox think we want to go to another URL. Solution Add the preventDefault manually. This reveals another issue which is solved by importing this PR's code https://github.com/summernote/summernote/pull/3327 (with adaptation for our dinosaurus version) OPW-2158112 closes odoo/odoo#42759 X-original-commit: 197145ac19fd65dcfbcbae81c8b5dd54025185a4 Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/module/DragAndDrop.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/module/DragAndDrop.js b/addons/web_editor/static/lib/summernote/src/js/module/DragAndDrop.js
index b8871599c6f..9e96dc329eb 100644
--- a/addons/web_editor/static/lib/summernote/src/js/module/DragAndDrop.js
+++ b/addons/web_editor/static/lib/summernote/src/js/module/DragAndDrop.js
@@ -70,6 +70,10 @@ define([
var dataTransfer = event.originalEvent.dataTransfer;
var layoutInfo = dom.makeLayoutInfo(event.currentTarget || event.target);
+ /* ODOO: start_modification */
+ event.preventDefault();
+ /* ODOO: end_modification */
+
if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
event.preventDefault();
layoutInfo.editable().focus();
@@ -83,6 +87,12 @@ define([
var type = dataTransfer.types[i];
var content = dataTransfer.getData(type);
+ /* ODOO: start_modification */
+ if (type.toLowerCase().indexOf('_moz_') > -1) {
+ return;
+ }
+ /* ODOO: end_modification */
+
if (type.toLowerCase().indexOf('text') > -1) {
layoutInfo.holder().summernote('pasteHTML', content);
} else {