Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Fix if/else delete
Browse files Browse the repository at this point in the history
  • Loading branch information
kaviththiranga committed Feb 12, 2017
1 parent b224627 commit 5abc851
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions modules/web/js/ballerina/views/if-else-statement-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ define(['require', 'lodash', 'log', 'property_pane_utils', './ballerina-statemen
childrenView.stopListening();
});
d3.select("#_" +this._model.id).remove();
this.getDiagramRenderingContext().getViewOfModel(this._model.getParent()).getStatementContainer()
.removeInnerDropZone(this._model);
this.getBoundingBox().w(0).h(0);
};

Expand Down
12 changes: 8 additions & 4 deletions modules/web/js/ballerina/views/statement-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,14 @@ define(['lodash', 'jquery', 'd3', 'log', 'd3utils', './point', './ballerina-view
this._managedStatements.splice(childStatementIndex, 1);

if (this._widestStatementView === childStatementView) {
// we have deleted the widest statement.
this._widestStatementView = computeWidestStatementView(this._managedStatements,
this.diagramRenderingContext);
this._updateContainerWidth(this._widestStatementView.getBoundingBox().w());
if(!_.isEmpty(this._managedStatements)) {
// we have deleted the widest statement.
this._widestStatementView = computeWidestStatementView(this._managedStatements,
this.diagramRenderingContext);
this._updateContainerWidth(this._widestStatementView.getBoundingBox().w());
} else {
this._widestStatementView = undefined;
}
}
};

Expand Down

0 comments on commit 5abc851

Please sign in to comment.