ajax post that creates a mapping when you double click on a in commons node in the map
This commit is contained in:
parent
564d18df4d
commit
2cff8ce37e
1 changed files with 12 additions and 5 deletions
|
@ -31,11 +31,18 @@ function selectEdgeOnClickHandler(adj, e) {
|
||||||
function nodeDoubleClickHandler(node, e) {
|
function nodeDoubleClickHandler(node, e) {
|
||||||
node.setData('inCommons', false);
|
node.setData('inCommons', false);
|
||||||
deselectNode(node);
|
deselectNode(node);
|
||||||
console.log("Here's the node you clicked:");
|
if (window.mapid) {
|
||||||
console.log(node);
|
$.post('/mappings',
|
||||||
if ($('.maps.onMap').length > 0) {
|
{
|
||||||
//TODO var mappingId = createAMapping(alert('unimp'));
|
topic: {id: node.id},
|
||||||
//node.setData('mappingid', mappingId);
|
map: {id: window.mapid},
|
||||||
|
xloc: node.pos.x,
|
||||||
|
yloc: node.pos.y
|
||||||
|
},
|
||||||
|
function(data, textStatus, jqXHR) {
|
||||||
|
console.log(data);
|
||||||
|
node.setData('mappingid', data.id);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}//doubleClickNodeHandler
|
}//doubleClickNodeHandler
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue