removeField func for editor

This commit is contained in:
2022-02-11 12:09:58 +01:00
parent e15cc14b9d
commit d7b0e2e0d1
@@ -1,5 +1,6 @@
import { ZeroEditorField } from "zero/schemas";
import { ZeroEditorFieldImpl, ZeroEditorFieldConfiguration, createFieldProxy } from "./editor-field";
import { arrayRemove } from '../utils';
export class ZeroEditorCanvasBase
@@ -26,6 +27,16 @@ export class ZeroEditorCanvasBase
{
return this.fields.find(x => x.path == path);
}
removeField(path: string): void
{
let field = this.getField(path);
if (field)
{
arrayRemove(this.fields, field);
}
}
}