mirror of
https://github.com/openharmony/applications_notes.git
synced 2026-07-21 00:26:37 -04:00
@@ -678,8 +678,7 @@ export struct EditTitleDialog {
|
||||
.backgroundColor($r("app.color.title_input_bg_color"))
|
||||
.width('90%')
|
||||
.onChange((value: string) => {
|
||||
let reg = /^\S+$/
|
||||
if (this.inputName == value && reg.test(value)) {
|
||||
if (this.inputName == value) {
|
||||
this.isEquivalentVal = true
|
||||
} else {
|
||||
this.isEquivalentVal = false
|
||||
@@ -716,9 +715,13 @@ export struct EditTitleDialog {
|
||||
.width('48%')
|
||||
.onClick(() => {
|
||||
this.editTitleDialog.close()
|
||||
this.confirm(this.inputName)
|
||||
// @ts-ignore
|
||||
inputMethod.getController().stopInputSession();
|
||||
if (this.inputName.replace(/\s+/g,'') == '') {
|
||||
return
|
||||
} else {
|
||||
this.confirm(this.inputName)
|
||||
}
|
||||
})
|
||||
}.width('100%')
|
||||
.margin({ top: 21, bottom: 25 })
|
||||
|
||||
@@ -351,6 +351,9 @@ export struct ToolBarComp {
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "javascript:RICH_EDITOR.insertImage('" + path + "')"
|
||||
})
|
||||
this.issave = 1
|
||||
// 保存笔记信息到数据库
|
||||
this.controllerShow.runJavaScript({script:"getHtmlContent"})
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -457,6 +460,7 @@ export struct NoteContentOverViewComp {
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
LogUtil.info(TAG, "NoteContentOverViewComp MenuBuilder, set continue note success")
|
||||
NoteUtil.refreshAll()
|
||||
})
|
||||
}, noteItem => JSON.stringify(noteItem))
|
||||
}.listDirection(Axis.Vertical)
|
||||
|
||||
@@ -60,6 +60,15 @@ export struct NoteContentComp {
|
||||
private context = getContext(this)
|
||||
@StorageLink('ScrollTopPercent') scrollTopPercent: number = 0.0
|
||||
@StorageLink('isUpdate') isUpdate: boolean = false
|
||||
@StorageLink('refreshCurrentNote')@Watch('isDatacChange') refreshCurrentNote: boolean = false
|
||||
|
||||
isDataChange() {
|
||||
if (!this.refreshCurrentNote) {
|
||||
return
|
||||
}
|
||||
this.controllerShow.runJavaScript({script:"RICH_EDITOR.setHtml('" + this.selectedNoteData.content_text + "')"})
|
||||
this.refreshCurrentNote = false
|
||||
}
|
||||
|
||||
storeScrollTop(scrollTop: number) {
|
||||
if (scrollTop < 0) {
|
||||
@@ -360,6 +369,7 @@ export struct NoteContentOverViewComp {
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
LogUtil.info(TAG, "NoteContentOverViewComp, MenuBuilder, set continue note success")
|
||||
NoteUtil.refreshAll()
|
||||
})
|
||||
}, noteItem => noteItem.uuid)
|
||||
}.listDirection(Axis.Vertical)
|
||||
@@ -634,6 +644,9 @@ export struct ToolBarComp {
|
||||
this.controllerShow.runJavaScript({
|
||||
script: "javascript:RICH_EDITOR.insertImage('" + path + "')"
|
||||
})
|
||||
this.issave = 1
|
||||
// 保存笔记信息到数据库
|
||||
this.controllerShow.runJavaScript({script:"getHtmlContent"})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,6 +287,7 @@ export struct NoteContentOverViewComp {
|
||||
let continueNote: string = JSON.stringify(this.selectedNoteData.toNoteObject())
|
||||
AppStorage.SetOrCreate<string>('ContinueNote', continueNote)
|
||||
LogUtil.info(TAG, 'MenuBuilder, set continue note success')
|
||||
NoteUtil.refreshAll()
|
||||
})
|
||||
}, noteItem => noteItem.uuid)
|
||||
}
|
||||
|
||||
@@ -355,10 +355,9 @@ export struct NoteItemComp {
|
||||
LongPressGesture()
|
||||
.onAction(() => {
|
||||
if (this.longpress == false) {
|
||||
this.isChecked = false
|
||||
this.longpress = true
|
||||
NoteUtil.setNoteChecked(this.CheckedNoteArray, this.noteItem)
|
||||
this.isChecked = NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem) ? true : false
|
||||
this.isChecked = NoteUtil.isNoteChecked(this.CheckedNoteArray, this.noteItem)
|
||||
}
|
||||
})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user