feat: add executeBlur api #262

This commit is contained in:
Hufe921
2023-10-26 22:03:51 +08:00
parent e5acf6efcb
commit d9f7d5045f
4 changed files with 28 additions and 1 deletions
+2
View File
@@ -10,6 +10,7 @@ export class Command {
public executeBackspace: CommandAdapt['backspace']
public executeSetRange: CommandAdapt['setRange']
public executeForceUpdate: CommandAdapt['forceUpdate']
public executeBlur: CommandAdapt['blur']
public executeUndo: CommandAdapt['undo']
public executeRedo: CommandAdapt['redo']
public executePainter: CommandAdapt['painter']
@@ -112,6 +113,7 @@ export class Command {
this.executeBackspace = adapt.backspace.bind(adapt)
this.executeSetRange = adapt.setRange.bind(adapt)
this.executeForceUpdate = adapt.forceUpdate.bind(adapt)
this.executeBlur = adapt.blur.bind(adapt)
// 撤销、重做、格式刷、清除格式
this.executeUndo = adapt.undo.bind(adapt)
this.executeRedo = adapt.redo.bind(adapt)
+5
View File
@@ -172,6 +172,11 @@ export class CommandAdapt {
})
}
public blur() {
this.range.clearRange()
this.draw.getCursor().recoveryCursor()
}
public undo() {
const isReadonly = this.draw.isReadonly()
if (isReadonly) return