Skip to content

Commit

Permalink
Updated the arch editor deletion. Fixes #992
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Mar 20, 2017
1 parent 619a0b8 commit 3d2e514
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/visualizers/panels/ArchIndex/ArchIndexControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,28 @@ define([
return desc;
};

ArchIndexControl.prototype._initWidgetEventHandlers = function () {
this._widget.deletePipeline = id => {
var node = this._client.getNode(id),
name = node.getAttribute('name'),
msg = `Deleted "${name}" architecture`;


this._client.startTransaction(msg);
this._client.deleteNode(id);
this._client.completeTransaction();
};

this._widget.setName = (id, name) => {
var oldName = this._client.getNode(id).getAttribute('name'),
msg = `Renaming architecture: "${oldName}" -> "${name}"`;

if (oldName !== name && !/^\s*$/.test(name)) {
this._client.startTransaction(msg);
this._client.setAttribute(id, 'name', name);
this._client.completeTransaction();
}
};
};
return ArchIndexControl;
});

0 comments on commit 3d2e514

Please sign in to comment.