Skip to content

Commit

Permalink
Passing the correct source and parent id - DnD WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuja Kumar committed Dec 23, 2015
1 parent 5912ee3 commit 488966e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/resources/static/js/views/tree-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ define(function(require) {
var TagsView = require('views/tags-view');
var treeData;
var tree = {};
var draggedNodeId;

$(".rf-col-2").mCustomScrollbar({
theme : "minimal-dark"
Expand Down Expand Up @@ -1129,6 +1130,7 @@ define(function(require) {
* This function MUST be defined to enable dragging for the
* tree. Return false to cancel dragging of node.
*/
draggedNodeId = node.key;
return true;
},
dragEnter : function(node, data) {
Expand Down Expand Up @@ -1221,9 +1223,10 @@ define(function(require) {
});

function repositionNodes(node, data){
console.log("this is being dragged "+draggedNodeId);
$.ajax({
//ToDo: newPosition to be picked up dynamically
url : APP.config.baseUrl + '/nodes/' + node.key + '/move?newParentId='+node.parent.key+'&newPosition=1',
url : APP.config.baseUrl + '/nodes/' + draggedNodeId + '/move?newParentId='+node.key+'&newPosition=1',
type : 'post',
dataType : 'json',
contentType : "application/json",
Expand Down

0 comments on commit 488966e

Please sign in to comment.