Skip to content

Commit

Permalink
Updated Delete button for ptrs. Fixes #207
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Jun 4, 2016
1 parent 3ea0099 commit 857be35
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
17 changes: 16 additions & 1 deletion src/visualizers/widgets/OperationInterfaceEditor/Buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,25 @@ define([

};

var Delete = function(params) {
EasyDAGButtons.DeleteOne.call(this, params);
};

_.extend(Delete.prototype, EasyDAGButtons.DeleteOne.prototype);

Delete.prototype._onClick = function(item) {
// Check if it is a pointer or
if (item.desc.isPointer) {
this.removePtr(item.name);
} else {
this.deleteNode(item.id);
}
};

return {
AddOutput: AddOutput,
AddInput: AddInput,
AddRef: AddRef,
Delete: EasyDAGButtons.Delete
Delete: Delete
};
});
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,5 @@ define([
this.addRefTo(target.node.id);
};

OperationInterfaceEditorWidget.prototype.removeItem = function(item) {
if (item.desc.isPointer) {
this.removePtr(item.name);
} else {
this.removeSubtreeAt(item.id);
}
};

return OperationInterfaceEditorWidget;
});

0 comments on commit 857be35

Please sign in to comment.