allow Enter to keep all selected nodes in commons
This commit is contained in:
parent
f714212423
commit
6ac05fa2c6
2 changed files with 20 additions and 0 deletions
|
@ -29,6 +29,20 @@ function selectEdgeOnClickHandler(adj, e) {
|
||||||
}//selectEdgeOnClickHandler
|
}//selectEdgeOnClickHandler
|
||||||
|
|
||||||
function nodeDoubleClickHandler(node, e) {
|
function nodeDoubleClickHandler(node, e) {
|
||||||
|
keepFromCommons(node);
|
||||||
|
}
|
||||||
|
|
||||||
|
function enterKeyHandler() {
|
||||||
|
var selectedNodesCopy = MetamapsModel.selectedNodes.slice(0);
|
||||||
|
var len = selectedNodesCopy.length;
|
||||||
|
for (var i = 0; i < len; i += 1) {
|
||||||
|
n = selectedNodesCopy[i];
|
||||||
|
keepFromCommons(n);
|
||||||
|
}//for
|
||||||
|
Mconsole.plot();
|
||||||
|
}//enterKeyHandler
|
||||||
|
|
||||||
|
function keepFromCommons(node) {
|
||||||
if (userid == null) {
|
if (userid == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,3 +286,9 @@ function MconsoleReset() {
|
||||||
Mconsole.canvas.scale((1/mX),(1/mY));
|
Mconsole.canvas.scale((1/mX),(1/mY));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('*').keypress(function(e) {
|
||||||
|
if (e.which == 13) {
|
||||||
|
enterKeyHandler();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue