!279 修复备忘录添加有序列表后无法取消的问题

Merge pull request !279 from 张宏/note
This commit is contained in:
openharmony_ci 2024-07-26 08:58:47 +00:00 committed by Gitee
commit 173612e12c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -82,14 +82,12 @@ RICH_EDITOR.getListStyle = function () {
if (child.nodeName === 'OL') { if (child.nodeName === 'OL') {
console.info('insertOrderedList'); console.info('insertOrderedList');
document.execCommand('insertOrderedList', false, null); document.execCommand('insertOrderedList', false, null);
child.style['list-style']; return child.style['list-style'];
break;
} }
if (child.nodeName === 'UL') { if (child.nodeName === 'UL') {
console.info('insertUnorderedList'); console.info('insertUnorderedList');
document.execCommand('insertUnorderedList', false, null); document.execCommand('insertUnorderedList', false, null);
child.style['list-style']; return child.style['list-style'];
break;
} }
if (child.parentNode) { if (child.parentNode) {
child = child.parentNode; child = child.parentNode;
@ -458,7 +456,6 @@ RICH_EDITOR.insertImageHtml = function (contents) {
let img = document.createElement('img'); let img = document.createElement('img');
img.src = contents; img.src = contents;
selection.getRangeAt(0).insertNode(img); selection.getRangeAt(0).insertNode(img);
return;
}; };
document.addEventListener('click', (e) => { document.addEventListener('click', (e) => {