From 01c2d73921783c1d72444afb1b67d0d8fa3325ad Mon Sep 17 00:00:00 2001 From: nobbo Date: Mon, 19 Feb 2024 20:29:05 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=84=E9=81=BF=E6=8E=A5=E5=8F=A3javaScriptP?= =?UTF-8?q?roxy=E5=BC=82=E5=B8=B8=E5=AF=BC=E8=87=B4=E7=9A=84js=E8=B0=83?= =?UTF-8?q?=E7=94=A8=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- .../src/main/resources/rawfile/rich_editor.js | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index 950ccc7..ffbbb28 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -400,13 +400,15 @@ function getImagePathFromContent(contentInfo) { } function scheduledSaveContent() { - console.info('scheduledSaveContent'); - var htmlString = RICH_EDITOR.getHtml(); - let imgName = getImagePathFromContent(htmlString); - htmlString = window.btoa(unescape(encodeURIComponent(htmlString))); - callBackToApp.callbackImagePath(imgName); - var str = callBackToApp.callbackScheduledSave(htmlString); - console.info('scheduledSaveContent end'); + if (callBackToApp !== undefined) { + console.info('scheduledSaveContent'); + var htmlString = RICH_EDITOR.getHtml(); + let imgName = getImagePathFromContent(htmlString); + htmlString = window.btoa(unescape(encodeURIComponent(htmlString))); + callBackToApp.callbackImagePath(imgName); + var str = callBackToApp.callbackScheduledSave(htmlString); + console.info('scheduledSaveContent end'); + } } document.body.addEventListener('paste', (event) => { @@ -504,7 +506,5 @@ RICH_EDITOR.getFocus = function () { } document.getElementById('editorjs_box').addEventListener('click', () => { - if (callBackToApp.getBreakPoint() === 'sm') { - document.getElementById('buttonBox').style.display = 'flex'; - } + document.getElementById('buttonBox').style.display = 'flex'; }) \ No newline at end of file