feat:菜单栏交互状态

This commit is contained in:
黄云飞
2021-11-18 16:56:49 +08:00
parent 8926127fa5
commit 6027141c2b
5 changed files with 72 additions and 23 deletions
+3 -2
View File
@@ -23,12 +23,13 @@ export class GlobalEvent {
register() {
this.cursor = this.draw.getCursor()
document.addEventListener('keyup', () => {
this.setRangeStyle()
})
document.addEventListener('click', (evt) => {
this.recoverCursor(evt)
this.setRangeStyle()
})
document.addEventListener('mouseup', () => {
this.setDragState()
})
+2 -2
View File
@@ -59,13 +59,13 @@ export class RangeManager {
const color = curElement.color || null
const highlight = curElement.highlight || null
// 菜单
const format = !!this.draw.getPainterStyle()
const painter = !!this.draw.getPainterStyle()
const undo = this.historyManager.isCanUndo()
const redo = this.historyManager.isCanRedo()
this.listener.rangeStyleChange({
undo,
redo,
format,
painter,
bold,
italic,
underline,
+1 -1
View File
@@ -1,7 +1,7 @@
export interface IRangeStype {
undo: boolean;
redo: boolean;
format: boolean;
painter: boolean;
bold: boolean;
italic: boolean;
underline: boolean;