feat: add zone field to contextmenu context

pr675
Hufe921 3 years ago
parent a805590696
commit 2064236d94

@ -138,7 +138,8 @@ export class ContextMenu {
const elementList = this.draw.getElementList() const elementList = this.draw.getElementList()
const startElement = elementList[startIndex] || null const startElement = elementList[startIndex] || null
const endElement = elementList[endIndex] || null const endElement = elementList[endIndex] || null
// 当前区域
const zone = this.draw.getZone().getZone()
return { return {
startElement, startElement,
endElement, endElement,
@ -146,7 +147,8 @@ export class ContextMenu {
editorHasSelection, editorHasSelection,
editorTextFocus, editorTextFocus,
isInTable, isInTable,
isCrossRowCol isCrossRowCol,
zone
} }
} }

@ -1,4 +1,5 @@
import { Command } from '../../core/command/Command' import { Command } from '../../core/command/Command'
import { EditorZone } from '../../dataset/enum/Editor'
import { IElement } from '../Element' import { IElement } from '../Element'
export interface IContextMenuContext { export interface IContextMenuContext {
@ -9,6 +10,7 @@ export interface IContextMenuContext {
editorTextFocus: boolean editorTextFocus: boolean
isInTable: boolean isInTable: boolean
isCrossRowCol: boolean isCrossRowCol: boolean
zone: EditorZone
} }
export interface IRegisterContextMenu { export interface IRegisterContextMenu {

Loading…
Cancel
Save