From 1846d0eeea2cfd9f1145e70fdae251353c9aaa28 Mon Sep 17 00:00:00 2001 From: nobbo Date: Fri, 13 Jan 2023 15:56:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9web=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E9=97=AE=E9=A2=98&&=E4=BF=AE=E6=94=B9=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E4=B8=8D=E5=88=B7=E6=96=B0=E9=97=AE=E9=A2=98&&?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E5=A4=B9=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E9=97=AE=E9=A2=98&&=E9=80=82=E9=85=8D=E6=96=B0=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nobbo --- .../resources/src/main/resources/rawfile/editor_style.css | 1 - .../resources/src/main/resources/rawfile/rich_editor.js | 3 ++- features/src/main/ets/components/CusDialogComp.ets | 6 +++++- product/default/src/main/ets/pages/MyNoteHome.ets | 8 ++++++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/common/resources/src/main/resources/rawfile/editor_style.css b/common/resources/src/main/resources/rawfile/editor_style.css index d296b94..fa00ab4 100644 --- a/common/resources/src/main/resources/rawfile/editor_style.css +++ b/common/resources/src/main/resources/rawfile/editor_style.css @@ -91,7 +91,6 @@ body { } .edit-box { - overflow: hidden; width: 100%; height: 100%; display: flex; diff --git a/common/resources/src/main/resources/rawfile/rich_editor.js b/common/resources/src/main/resources/rawfile/rich_editor.js index be51ea8..5d62c95 100644 --- a/common/resources/src/main/resources/rawfile/rich_editor.js +++ b/common/resources/src/main/resources/rawfile/rich_editor.js @@ -430,7 +430,8 @@ RICH_EDITOR.insertImageHtml = function (contents) { document.addEventListener('click', (e) => { console.info(`lsq: e is ${JSON.stringify(e)}`) - if (e.id !== 'editorjs') { + var parent = document.getElementById('editorjs'); + if (parent.id !== 'editorjs') { e.preventDefault() } }) diff --git a/features/src/main/ets/components/CusDialogComp.ets b/features/src/main/ets/components/CusDialogComp.ets index 7c67f13..d0d067f 100644 --- a/features/src/main/ets/components/CusDialogComp.ets +++ b/features/src/main/ets/components/CusDialogComp.ets @@ -121,7 +121,11 @@ export struct NewOrEditFolderDialog { .width('48%') .onClick(() => { this.newOrEditFolderDialogCtl.close() - this.confirm(this.selectedColor, this.inputName) + if (this.inputName.replace(/\s+/g, '') == '') { + return + } else { + this.confirm(this.selectedColor, this.inputName) + } inputMethod.getController().stopInputSession(); }) }.width('100%') diff --git a/product/default/src/main/ets/pages/MyNoteHome.ets b/product/default/src/main/ets/pages/MyNoteHome.ets index 2aa9133..a29aee3 100644 --- a/product/default/src/main/ets/pages/MyNoteHome.ets +++ b/product/default/src/main/ets/pages/MyNoteHome.ets @@ -22,6 +22,7 @@ import RdbStoreUtil from '@ohos/utils/src/main/ets/default/baseUtil/RdbStoreUtil import NoteData from '@ohos/utils/src/main/ets/default/model/databaseModel/NoteData' import inputMethod from '@ohos.inputmethod'; import router from '@system.router'; +import abilityAccessCtrl from '@ohos.abilityAccessCtrl'; @Entry @Component @@ -85,7 +86,10 @@ export struct MyNoteHomeComp { } LogUtil.info(this.TAG, 'permissions need to require from user') let context: any = getContext(this); - context.requestPermissionsFromUser(permissionList).then((data) => { + let AtManager = abilityAccessCtrl.createAtManager(); + //requestPermissionsFromUser会判断权限的授权状态来决定是否唤起弹窗 + // @ts-ignore + AtManager.requestPermissionsFromUser(context, ["ohos.permission.MANAGE_DISPOSED_APP_STATUS"]).then((data) => { LogUtil.info(this.TAG, 'data permissions : ' + data.permissions) LogUtil.info(this.TAG, 'data result: ' + data.authResults) let sum = 0 @@ -93,7 +97,7 @@ export struct MyNoteHomeComp { sum += data.authResults[i] } LogUtil.info(this.TAG, 'request permissions sum: ' + sum) - }, (err) => { + }).catch((err) => { LogUtil.warn(this.TAG, 'failed to requestPermissionsFromUser : ' + err.code); }) -- Gitee