fix: 🐛 add toolsAddable config for interacting (#1124)

This commit is contained in:
vector
2021-06-23 10:26:42 +08:00
committed by GitHub
parent 26dfe25801
commit 03f81e14ad

View File

@ -676,6 +676,9 @@ export class CellView<
addTools(options: ToolsView.Options | null): this
addTools(tools: ToolsView | null): this
addTools(config: ToolsView | ToolsView.Options | null) {
if (!this.can('toolsAddable')) {
return this
}
this.removeTools()
if (config) {
const tools = ToolsView.isToolsView(config)
@ -902,6 +905,9 @@ export namespace CellView {
nodeMovable?: Interactable
magnetConnectable?: Interactable
stopDelegateOnDragging?: Interactable
// general
toolsAddable?: Interactable
}
export type InteractionNames = keyof InteractionMap