|
@@ -1266,11 +1266,17 @@ export class GraphFrame {
|
|
|
}
|
|
|
|
|
|
public dispose() {
|
|
|
- this.isCollapsed = false;
|
|
|
-
|
|
|
- this._nodes.forEach(node => {
|
|
|
- node.enclosingFrameId = -1;
|
|
|
- });
|
|
|
+ if(this.isCollapsed) {
|
|
|
+ while(this._nodes.length > 0) {
|
|
|
+ this._nodes[0].dispose();
|
|
|
+ }
|
|
|
+ this.isCollapsed = false;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this._nodes.forEach(node => {
|
|
|
+ node.enclosingFrameId = -1;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
if (this._onSelectionChangedObserver) {
|
|
|
this._ownerCanvas.globalState.onSelectionChangedObservable.remove(this._onSelectionChangedObserver);
|
|
@@ -1299,7 +1305,7 @@ export class GraphFrame {
|
|
|
height: this._height,
|
|
|
color: this._color.asArray(),
|
|
|
name: this.name,
|
|
|
- isCollapsed: false, //keeping closed to make reimporting cleaner
|
|
|
+ isCollapsed: true, //keeping closed to make reimporting cleaner
|
|
|
blocks: this.nodes.map(n => n.block.uniqueId),
|
|
|
comments: this._comments
|
|
|
}
|