Skip to content

Commit

Permalink
Use controller event handlers. Closes #1969 (#1970)
Browse files Browse the repository at this point in the history
  • Loading branch information
brollb committed Nov 4, 2020
1 parent 6ed7f2d commit 7c907df
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ define([

OpIntDecorator.prototype.editAttributeMeta = function(name, defSchema) {
var dialog = new AttributeDetailsDialog(),
node = this.client.getNode(this._node.id),
attrNames = node.getValidAttributeNames(),
attrNames = this.getValidAttributeNames(),
attrInfo = this._node.attributes[name] || defSchema,
schema,
i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ define([

this._widget.setAttributeMeta = this.setAttributeMeta.bind(this);
this._widget.deleteAttribute = this.deleteAttribute.bind(this);
this._widget.getValidAttributeNames = this.getValidAttributeNames.bind(this);
};

OperationInterfaceEditorEvents.prototype.getCreationNode = function(type, id) {
Expand Down Expand Up @@ -338,5 +339,10 @@ define([
this._client.completeTransaction();
};

OperationInterfaceEditorEvents.prototype.getValidAttributeNames = function(nodeId) {
const node = this.client.getNode(nodeId);
return node.getValidAttributeNames();
};

return OperationInterfaceEditorEvents;
});
1 change: 1 addition & 0 deletions src/visualizers/widgets/OperationInterfaceEditor/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ define([
this.decorator.changePtrName = this.changePtrName.bind(this);
this.decorator.setAttributeMeta = this.setAttributeMeta.bind(this);
this.decorator.deleteAttribute = this.deleteAttribute.bind(this);
this.decorator.getValidAttributeNames = this.getValidAttributeNames.bind(this);
};

return Item;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ define([
this._widget.deleteAttribute(item.id, name);
};

this.ItemClass.prototype.getValidAttributeNames = function() {
const item = this;
return this._widget.getValidAttributeNames(item.id);
};
};

OperationInterfaceEditorWidget.prototype.onAddItemSelected = function(selected, isInput) {
Expand Down

0 comments on commit 7c907df

Please sign in to comment.