ajax post that creates a mapping when you double click on a in commons node in the map

This commit is contained in:
Devin Howard 2013-02-28 20:42:09 -05:00
parent 564d18df4d
commit 2cff8ce37e

View file

@ -31,11 +31,18 @@ function selectEdgeOnClickHandler(adj, e) {
function nodeDoubleClickHandler(node, e) {
node.setData('inCommons', false);
deselectNode(node);
console.log("Here's the node you clicked:");
console.log(node);
if ($('.maps.onMap').length > 0) {
//TODO var mappingId = createAMapping(alert('unimp'));
//node.setData('mappingid', mappingId);
if (window.mapid) {
$.post('/mappings',
{
topic: {id: node.id},
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