feat: make isMutator public (#6316)

* feat: make isMutator public

* fix: move isFlyout and isMutator to getters

* chore: delete change detector test
This commit is contained in:
Beka Westberg
2022-08-08 15:35:38 +00:00
committed by GitHub
parent 3d7dc2c69d
commit 8f4b49a771
4 changed files with 17 additions and 46 deletions

View File

@@ -255,7 +255,7 @@ export abstract class Flyout extends DeleteArea implements IFlyout {
this.workspace_.setMetricsManager(
new FlyoutMetricsManager(this.workspace_, this));
this.workspace_.isFlyout = true;
this.workspace_.internalIsFlyout = true;
// Keep the workspace visibility consistent with the flyout's visibility.
this.workspace_.setVisible(this.isVisible_);

View File

@@ -191,7 +191,7 @@ export class Mutator extends Icon {
workspaceOptions.languageTree = toolbox.convertToolboxDefToJson(quarkXml);
}
this.workspace_ = this.newWorkspaceSvg(workspaceOptions);
this.workspace_.isMutator = true;
this.workspace_.internalIsMutator = true;
this.workspace_.addChangeListener(eventUtils.disableOrphans);
// Mutator flyouts go inside the mutator workspace's <g> rather than in

View File

@@ -61,14 +61,27 @@ export class Workspace implements IASTNodeLocation {
*/
rendered = false;
/**
* Is this workspace the surface for a flyout?
* @internal
*/
internalIsFlyout = false;
/** Is this workspace the surface for a flyout? */
isFlyout = false;
get isFlyout(): boolean {
return this.internalIsFlyout;
}
/**
* Is this workspace the surface for a mutator?
* @internal
*/
isMutator = false;
internalIsMutator = false;
/** Is this workspace the surface for a mutator? */
get isMutator(): boolean {
return this.internalIsMutator;
}
/**
* Returns `true` if the workspace is currently in the process of a bulk