From 9e3dc4b67238c884ea70aa3e0720a7aa09388a73 Mon Sep 17 00:00:00 2001 From: nobbo Date: Fri, 14 Apr 2023 09:58:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9jscrash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- .../components/NoteContentCompPortrait.ets | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/features/src/main/ets/components/NoteContentCompPortrait.ets b/features/src/main/ets/components/NoteContentCompPortrait.ets index 35a179f..a0b3f8f 100644 --- a/features/src/main/ets/components/NoteContentCompPortrait.ets +++ b/features/src/main/ets/components/NoteContentCompPortrait.ets @@ -291,20 +291,20 @@ export struct NoteContentCompPortrait { .onScroll((event) => { this.storeScrollTop(event.yOffset) }) + .onClick(() => { + if (time_id) { + clearInterval(time_id) + } + // 添加定时器:3s自动保存 + time_id = setInterval(() => { + this.controllerShow.runJavaScript("scheduledSaveContent()") + }, 3000) + LogUtil.info(TAG, "setInterval time_id : " + time_id) + this.editModel = true + }) } .enabled(this.selectedNoteData && this.selectedNoteData.is_deleted == Delete.Yes ? false : true) .flexShrink(1) - .onClick(() => { - if (time_id) { - clearInterval(time_id) - } - // 添加定时器:3s自动保存 - time_id = setInterval(() => { - this.controllerShow.runJavaScript("scheduledSaveContent()") - }, 3000) - LogUtil.info(TAG, "setInterval time_id : " + time_id) - this.editModel = true - }) .margin({ top: 16 }) .width(StyleConstants.PERCENTAGE_100) }