summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib/summernote/src/js
diff options
context:
space:
mode:
authorjvm-odoo <jvm@odoo.com>2020-03-25 09:55:17 +0000
committerjvm-odoo <jvm@odoo.com>2020-04-02 06:12:04 +0000
commit7e2504ec0c9d8305bcdeb1e68a64054d84d74124 (patch)
treeaefb1a0f49de197a114d68a94099583ecc37ee50 /addons/web_editor/static/lib/summernote/src/js
parent4496ce31aaafef6bd09004878a4e41fc243bc777 (diff)
[FIX] web_editor: fix makeLayoutInfo
Issue - Install Website - Edit your website Do this 8 times: - Add the block "Image - Text" under each product - Make image on left smaller and text longer - Edit the size/color of the title and the description There is some case where it will crash Cause We override the method who gets the editor: `x = $('[data-note-id="' + list.last($target.attr('id')) + '"]');` When there is more than 9 editors in the page (because we edited 10 different HTML fields), we reach the editor with ID 10 but the code erroneously will not find the editor with ID 0 Solution Use this instead: ``` x = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]'); ``` OPW-2218467 closes odoo/odoo#48810 X-original-commit: c95fad77ea5b4663130e256f76031560171f09e6 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com> Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/lib/summernote/src/js')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/core/dom.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/core/dom.js b/addons/web_editor/static/lib/summernote/src/js/core/dom.js
index 2250b50ac2a..f6a1960add6 100644
--- a/addons/web_editor/static/lib/summernote/src/js/core/dom.js
+++ b/addons/web_editor/static/lib/summernote/src/js/core/dom.js
@@ -122,7 +122,7 @@ define([
} else {
// ODOO: editor on [data-note-id] attribute
// $editor = $('#note-editor-' + list.last($target.attr('id').split('-')));
- $editor = $('[data-note-id="' + list.last($target.attr('id')) + '"]');
+ $editor = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]');
}
return buildLayoutInfo($editor);