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) { 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