From f70ca6d8955a98c823aaaa5e2537024832b27c64 Mon Sep 17 00:00:00 2001 From: ywx1281445 Date: Wed, 18 Sep 2024 15:39:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E6=9C=AC=E5=AF=B9?= =?UTF-8?q?=E9=BD=90=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ywx1281445 --- .../resources/src/main/resources/rawfile/rich_editor.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index bd9a32b..216ab6c 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -280,15 +280,18 @@ RICH_EDITOR.setOutdent = function () { }; RICH_EDITOR.setJustifyLeft = function () { - RICH_EDITOR.editor.style.textAlign = 'left'; + document.execCommand('justifyLeft', false, null); + RICH_EDITOR.editor.setAttribute('style', 'text-align: left;'); }; RICH_EDITOR.setJustifyCenter = function () { - RICH_EDITOR.editor.style.textAlign = 'center'; + document.execCommand('justifyCenter', false, null); + RICH_EDITOR.editor.setAttribute('style', 'text-align: center;'); }; RICH_EDITOR.setJustifyRight = function () { - RICH_EDITOR.editor.style.textAlign = 'right'; + document.execCommand('justifyRight', false, null); + RICH_EDITOR.editor.setAttribute('style', 'text-align: right;'); }; RICH_EDITOR.insertImage = function (url) { -- Gitee