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) {
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in a new issue