适配改变颜色按钮点击几次后不反应问题

Signed-off-by: nobbo <gaoshang22@huawei.com>
This commit is contained in:
nobbo
2022-09-21 10:11:53 +08:00
parent e9e6be544f
commit 535c898d3d
2 changed files with 13 additions and 1 deletions
@@ -390,6 +390,7 @@ export struct EditContentDialog {
@Consume('SelectedNoteData') selectedNoteData: NoteData
private circleColor: string
private fontSize: number
@StorageLink('CloseEditContentDialog') CloseEditContentDialog: boolean = AppStorage.Link('CloseEditContentDialog')
aboutToAppear() {
this.confirm("javascript:RICH_EDITOR.getFontSizes()")
@@ -577,6 +578,7 @@ export struct EditContentDialog {
.fillColor('#99182431')
.onClick(() => {
this.editContentDialogCtl.close()
this.CloseEditContentDialog = true
})
}
.height(36)
@@ -49,6 +49,7 @@ export struct NoteContentComp {
@Consume('LastSectionStatus') lastSectionStatus: number
@Consume('Issave') issave: number
@Consume('Search') search: boolean
@StorageLink('CloseEditContentDialog') CloseEditContentDialog: boolean = AppStorage.Link('CloseEditContentDialog')
controllerShow: WebController
private editContentFlag = false
@State uri1: string = ""
@@ -170,7 +171,10 @@ export struct NoteContentComp {
clearInterval(timeId)
}
timeId = setInterval(() => {
this.controllerShow.runJavaScript({ script: "scheduledSaveContent()" })
// this.controllerShow.runJavaScript({ script: "scheduledSaveContent()" })
if(this.CloseEditContentDialog){
this.controllerShow.runJavaScript({ script: "scheduledSaveContent()" })
}
}, 3000)
LogUtil.info(TAG, "setInterval timeId : " + timeId)
// save continue data
@@ -345,6 +349,7 @@ export struct ToolBarComp {
@Consume('Issave') issave: number
controllerShow: WebController
private context = getContext(this)
@StorageLink('CloseEditContentDialog') CloseEditContentDialog: boolean = AppStorage.Link('CloseEditContentDialog')
noteDataDeleteDialogCtl: CustomDialogController = new CustomDialogController({
builder: DeleteDialog({ onConfirm: this.onDeleteConfirm.bind(this) }),
alignment: DialogAlignment.Center,
@@ -384,6 +389,10 @@ export struct ToolBarComp {
customStyle: true,
})
exisApp() {
this.CloseEditContentDialog = true
}
confirm(excuteJs: string) {
this.controllerShow.runJavaScript({ script: excuteJs })
}
@@ -494,6 +503,7 @@ export struct ToolBarComp {
.onClick(() => {
// 退出键盘
inputMethod.getInputMethodController().stopInput();
this.CloseEditContentDialog = false
this.editContentDialogCtl.open()
})
}.width(42)