diff --git a/app/assets/javascripts/Jit/graphsettings.js b/app/assets/javascripts/Jit/graphsettings.js
index 2fbfb58d..e95dd01f 100644
--- a/app/assets/javascripts/Jit/graphsettings.js
+++ b/app/assets/javascripts/Jit/graphsettings.js
@@ -409,18 +409,18 @@ var nodeSettings = {
}
function selectEdgeOnClickHandler(adj, e) {
+ var showDesc = adj.getData("showDesc");
+ if (showDesc) {
+ deselectEdge(adj);
+ Mconsole.plot();
+ }
if (!e.shiftKey) {
for (var i = 0; i < selectedEdges.length; i += 1) {
var edge = selectedEdges[i];
deselectEdge(edge);
}
}
-
- var showDesc = adj.getData("showDesc");
- if (showDesc) {
- deselectEdge(adj);
- Mconsole.plot();
- } else if (!showDesc) {
+ if (!showDesc) {
selectEdge(adj);
Mconsole.plot();
}
@@ -703,7 +703,7 @@ function onCreateLabelHandler(domElement, node) {
var littleHTML = ' \
';
- if (userid == null && node.id != Mconsole.root) {
+ if ((userid == null || mapid == null) && node.id != Mconsole.root) {
littleHTML += ' \
\
\
-
\
';
@@ -903,7 +903,7 @@ function removeSelectedEdges() {
//delete mapping of id mapid
$.ajax({
type: "POST",
- url: "/mappings/" + mapid + "/" + id + "/removefrommap",
+ url: "/synapses/" + mapid + "/" + id + "/removefrommap",
});
}
hideEdge(edge);
@@ -966,3 +966,33 @@ function deselectEdge(edge) {
}
selectedEdges.splice(selectedEdges.indexOf(edge), 1);
}
+
+function hideSelectedNodes() {
+ Mconsole.graph.eachNode( function (n) {
+ if (n.data.$onCanvas == true && n.id != Mconsole.root) {
+ removeFromCanvas(n.id);
+ }
+ });
+}
+
+function removeSelectedNodes() {
+ Mconsole.graph.eachNode( function (n) {
+ if (n.data.$onCanvas == true && n.id != Mconsole.root) {
+ $.ajax({
+ type: "POST",
+ url: "/topics/" + mapid + "/" + n.id + "/removefrommap",
+ });
+ }
+ });
+}
+
+function deleteSelectedNodes() {
+ Mconsole.graph.eachNode( function (n) {
+ if (n.data.$onCanvas == true && n.id != Mconsole.root) {
+ $.ajax({
+ type: "DELETE",
+ url: "/topics/" + n.id,
+ });
+ }
+ });
+}
diff --git a/app/views/main/console.html.erb b/app/views/main/console.html.erb
index 06d53345..6d41dfab 100644
--- a/app/views/main/console.html.erb
+++ b/app/views/main/console.html.erb
@@ -1,7 +1,7 @@