!292 修复备忘录字体异常变化问题

Merge pull request !292 from 张宏/note
This commit is contained in:
openharmony_ci 2024-10-09 07:35:16 +00:00 committed by Gitee
commit c7d1b56716
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -104,7 +104,9 @@ RICH_EDITOR.setNumbers = function () {
if (listStyle === 'decimal') {
return;
}
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('insertOrderedList', false, null);
document.execCommand('fontSize', false, fontSize);
var selection;
var type;
if (window.getSelection) {
@ -135,7 +137,9 @@ RICH_EDITOR.setABC = function () {
if (listStyle === 'lower-alpha') {
return;
}
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('insertOrderedList', false, null);
document.execCommand('fontSize', false, fontSize);
var selection;
var type;
if (window.getSelection) {
@ -166,7 +170,9 @@ RICH_EDITOR.setBullets = function () {
if (listStyle === 'disc') {
return;
}
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('insertUnorderedList', false, null);
document.execCommand('fontSize', false, fontSize);
var selection;
var type;
if (window.getSelection) {
@ -197,7 +203,9 @@ RICH_EDITOR.setSquare = function () {
if (listStyle === 'square') {
return;
}
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('insertUnorderedList', false, null);
document.execCommand('fontSize', false, fontSize);
var selection;
var type;
if (window.getSelection) {
@ -280,18 +288,21 @@ RICH_EDITOR.setOutdent = function () {
};
RICH_EDITOR.setJustifyLeft = function () {
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('justifyLeft', false, null);
RICH_EDITOR.editor.setAttribute('style', 'text-align: left;');
document.execCommand('fontSize', false, fontSize);
};
RICH_EDITOR.setJustifyCenter = function () {
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('justifyCenter', false, null);
RICH_EDITOR.editor.setAttribute('style', 'text-align: center;');
document.execCommand('fontSize', false, fontSize);
};
RICH_EDITOR.setJustifyRight = function () {
let fontSize = document.queryCommandValue('fontSize');
document.execCommand('justifyRight', false, null);
RICH_EDITOR.editor.setAttribute('style', 'text-align: right;');
document.execCommand('fontSize', false, fontSize);
};
RICH_EDITOR.insertImage = function (url) {