Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resize only with ctrl #705

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions nengo_gui/static/components/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ Nengo.Component = function(parent, args) {
self.save_layout();
});

$(document).bind('keydown', function(event) {
if (event.ctrlKey) {
interact(self.div).resizable(false);
}
});
$(document).bind('keyup', function(event) {
interact(self.div).resizable(true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be inside an if (event.ctrlKey) check?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it should!

});


/** Open a WebSocket to the server */
this.uid = args.uid;
if (this.uid != undefined) {
Expand Down
12 changes: 12 additions & 0 deletions nengo_gui/static/components/netgraph_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,18 @@ Nengo.NetGraphItem = function(ng, info, minimap, mini_item) {
x:item.x, y:item.y,
width:item.width, height:item.height});
});

$(document).bind('keydown', function(event) {
if (event.ctrlKey) {
interact(self.area).resizable(false);
}
});
$(document).bind('keyup', function(event) {
if (event.ctrlKey) {
interact(self.area).resizable(true);
}
});

}

// Determine when to pull up the menu
Expand Down