Skip to content

Commit

Permalink
Update view.js (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
lutzroeder committed Jul 27, 2024
1 parent 679c219 commit a37fb0d
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions source/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -1004,15 +1004,21 @@ view.View = class {
stack[0].signature = signature;
this._updateActive(stack);
});
sidebar.on('activate', (sender, value) => {
this._graph.select([value]);
sidebar.on('focus', (sender, value) => {
this._graph.focus([value]);
});
sidebar.on('deactivate', () => {
this._graph.select(null);
sidebar.on('blur', (sender, value) => {
this._graph.blur([value]);
});
sidebar.on('select', (sender, value) => {
this.scrollTo(this._graph.activate(value));
});
sidebar.on('activate', (sender, value) => {
this.scrollTo(this._graph.select([value]));
});
sidebar.on('deactivate', () => {
this._graph.select(null);
});
this._sidebar.open(sidebar, 'Model Properties');
} catch (error) {
this.error(error, 'Error showing model properties.', null);
Expand Down Expand Up @@ -3494,6 +3500,8 @@ view.ModelSidebar = class extends view.ObjectSidebar {

addArgument(name, argument) {
const value = new view.ArgumentView(this._view, argument);
value.on('focus', (sender, value) => this.emit('focus', value));
value.on('blur', (sender, value) => this.emit('blur', value));
value.on('activate', (sender, value) => this.emit('activate', value));
value.on('deactivate', (sender, value) => this.emit('deactivate', value));
value.on('select', (sender, value) => this.emit('select', value));
Expand Down

0 comments on commit a37fb0d

Please sign in to comment.