[FIX] web_editor: checkbox without text change can now be checked

This commit is contained in:
Gorash
2019-09-19 07:40:47 +00:00
committed by David Monjoie
parent d1f25b178a
commit 42df7f84a4
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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]
@@ -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();