mirror of
https://gitee.com/openharmony/applications_notes
synced 2024-11-30 03:00:50 +00:00
commit
5b5e59ac40
@ -442,9 +442,15 @@ struct FolderItemComp {
|
||||
}
|
||||
// 刷新web界面
|
||||
if (this.portraitModel == false) {
|
||||
try {
|
||||
this.controllerShow.runJavaScript(
|
||||
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
)
|
||||
);
|
||||
LogUtil.info(this.TAG, `onClick runJavaScript setHtml success.`);
|
||||
} catch (error) {
|
||||
LogUtil.error(this.TAG, `onClick runJavaScript setHtml failed,code:${JSON.stringify(error.code)},
|
||||
message:${JSON.stringify(error.message)}.`);
|
||||
}
|
||||
}
|
||||
// save continue data
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
@ -501,9 +507,15 @@ struct FolderItemComp {
|
||||
}
|
||||
// 刷新web界面
|
||||
if (this.portraitModel == false) {
|
||||
try {
|
||||
this.controllerShow.runJavaScript(
|
||||
"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"
|
||||
)
|
||||
);
|
||||
LogUtil.info(this.TAG, `else runJavaScript setHtml success.`);
|
||||
} catch (error) {
|
||||
LogUtil.info(this.TAG, `else runJavaScript setHtml failed.code:${JSON.stringify(error.code)},
|
||||
message:${JSON.stringify(error.message)}`);
|
||||
}
|
||||
}
|
||||
// save continue data
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
|
@ -232,7 +232,13 @@ export struct NoteContent {
|
||||
clearInterval(timeID)
|
||||
}
|
||||
timeID = setInterval(() => {
|
||||
this.controllerShow.runJavaScript("scheduledSaveContent()")
|
||||
try {
|
||||
this.controllerShow.runJavaScript("scheduledSaveContent()");
|
||||
LogUtil.info(TAG, `runJavaScript scheduledSaveContent success.`);
|
||||
} catch (error) {
|
||||
LogUtil.info(TAG, `runJavaScript scheduledSaveContent failed.code:${JSON.stringify(error.code)},
|
||||
message:${JSON.stringify(error.message)}`);
|
||||
}
|
||||
}, 3000)
|
||||
LogUtil.info(TAG, "setInterval timeID : " + timeID)
|
||||
this.issave = 0
|
||||
@ -288,8 +294,15 @@ export struct ToolBarComp {
|
||||
.height(24)
|
||||
.width(24)
|
||||
.onClick(() => {
|
||||
this.controllerShow.runJavaScript("RICH_EDITOR.setInputEnabled(false)")
|
||||
this.controllerShow.runJavaScript("getHtmlContent()")
|
||||
try {
|
||||
this.controllerShow.runJavaScript("RICH_EDITOR.setInputEnabled(false)");
|
||||
this.controllerShow.runJavaScript("getHtmlContent()");
|
||||
LogUtil.info(TAG, `runJavaScript setInputEnabled and getHtmlContent success.`);
|
||||
} catch (error) {
|
||||
LogUtil.info(TAG, `runJavaScript setInputEnabled and getHtmlContent fail.code:${JSON.stringify(error.code)},
|
||||
message:${JSON.stringify(error.message)}`);
|
||||
}
|
||||
|
||||
// 清除定时器
|
||||
if (timeID != undefined) {
|
||||
LogUtil.info(TAG, "zoom, clearInterval timeID : " + timeID)
|
||||
|
@ -69,7 +69,13 @@ export struct NoteContentComp {
|
||||
if (!this.refreshCurrentNote) {
|
||||
return
|
||||
}
|
||||
this.controllerShow.runJavaScript("RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')")
|
||||
try {
|
||||
this.controllerShow.runJavaScript("RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')");
|
||||
LogUtil.info(TAG, `runJavaScript setHtml success.`);
|
||||
} catch (error) {
|
||||
LogUtil.error(TAG, `runJavaScript setHtml failed.code:${JSON.stringify(error.code)},
|
||||
message:${JSON.stringify(error.message)}`);
|
||||
}
|
||||
this.refreshCurrentNote = false
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user