feat: add executeBlur api #262
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user