diff options
| author | Gorash <chm@odoo.com> | 2019-09-18 12:15:05 +0000 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2019-09-19 07:40:47 +0000 |
| commit | 42df7f84a432b3dcff45ea7ae0a6d4abf0aef90a (patch) | |
| tree | e8c4eb2ff2e16c7add3d9f9d6656347fd16845a3 /addons | |
| parent | d1f25b178a165f2575a142f2a886ea2d6234cd51 (diff) | |
[FIX] web_editor: checkbox without text change can now be checked
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_editor/controllers/main.py | 2 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/editor/summernote.js | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/addons/web_editor/controllers/main.py b/addons/web_editor/controllers/main.py index cad5291d875..5a7ca5483f7 100644 --- a/addons/web_editor/controllers/main.py +++ b/addons/web_editor/controllers/main.py @@ -97,7 +97,7 @@ class Web_Editor(http.Controller): li = htmlelem.find(".//li[@id='checklist-id-" + str(checklistId) + "']") - if not self._update_checklist_recursive(li, checked, children=True, ancestors=True): + if not li or not self._update_checklist_recursive(li, checked, children=True, ancestors=True): return value value = etree.tostring(htmlelem[0][0], encoding='utf-8', method='html')[5:-6] diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index 03642ff177f..c2cf0d68d6c 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -1790,6 +1790,7 @@ $.summernote.pluginEvents.insertUnorderedList = function (event, editor, layoutI } r.clean().select(); event.preventDefault(); + return false; }; $.summernote.pluginEvents.insertOrderedList = function (event, editor, layoutInfo) { @@ -1797,6 +1798,7 @@ $.summernote.pluginEvents.insertOrderedList = function (event, editor, layoutInf }; $.summernote.pluginEvents.insertCheckList = function (event, editor, layoutInfo) { $.summernote.pluginEvents.insertUnorderedList(event, editor, layoutInfo, "checklist"); + $(range.create().sc.parentNode).trigger('input'); // to update checklist-id }; $.summernote.pluginEvents.indent = function (event, editor, layoutInfo, outdent) { var $editable = layoutInfo.editable(); |
