Skip to content

Commit ec8abfc

Browse files
committed
adjust moveNods targetPath, add doc
1 parent b45eef0 commit ec8abfc

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

js/gitana/repository/Branch.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,18 @@
468468
});
469469
},
470470

471-
moveNodes: function(sourceNodeIds, targetNodeId, options)
471+
/**
472+
* Moves the nodes described by the given array to the configured target node
473+
*
474+
* @hcained branch
475+
*
476+
* @param sourceNodeIds array of nodes to delete
477+
* @param targetNodeId id of move target. Default is "root":
478+
* @param targetPath optional relative path to targetNodeId for moving to a relative subdirectory
479+
*
480+
* @returns Gitana.Branch
481+
*/
482+
moveNodes: function(sourceNodeIds, targetNodeId, targetPath)
472483
{
473484
var self = this;
474485

@@ -477,10 +488,12 @@
477488
return self.getUri() + "/movenodes"
478489
}
479490

491+
if (!targetNodeId) targetNodeId = "root";
492+
480493
var payload = {};
481-
if (options && options.targetPath)
494+
if (targetPath)
482495
{
483-
payload.targetPath = options.targetPath;
496+
payload.targetPath = targetPath;
484497
}
485498

486499
payload.sourceNodeIds = sourceNodeIds;

0 commit comments

Comments
 (0)