Merge pull request #2957 from AdaskoTheBeAsT/master

move_node, copy_node - fixed signatures
This commit is contained in:
Basarat Ali Syed
2014-10-28 15:39:01 +11:00
2 changed files with 11 additions and 4 deletions
+5
View File
@@ -104,3 +104,8 @@ var treeWithNewCheckboxProperties = $('#treeWithNewCheckboxProperties').jstree({
}
});
var tree = $('a').jstree();
tree.move_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true);
tree.copy_node('a', 'b', 0, (node: any, new_par: any, pos: any) => { }, true, true);
+6 -4
View File
@@ -1003,10 +1003,11 @@ interface JSTree extends JQuery {
* @param {mixed} par the new parent
* @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0`
* @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
* @param {Boolean} internal parameter indicating if the parent node has been loaded
* @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded
* @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn
* @trigger move_node.jstree
*/
move_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void;
move_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void;
/**
* copy a node to a new parent
@@ -1015,10 +1016,11 @@ interface JSTree extends JQuery {
* @param {mixed} par the new parent
* @param {mixed} pos the position to insert at (besides integer values, "first" and "last" are supported, as well as "before" and "after"), defaults to integer `0`
* @param {function} callback a function to call once the move is completed, receives 3 arguments - the node, the new parent and the position
* @param {Boolean} internal parameter indicating if the parent node has been loaded
* @param {Boolean} is_loaded internal parameter indicating if the parent node has been loaded
* @param {Boolean} skip_redraw internal parameter indicating if the tree should be redrawn
* @trigger model.jstree copy_node.jstree
*/
copy_node: (obj: any, par: any, pos?: any, callback?: any, internal?: boolean) => void;
copy_node: (obj: any, par: any, pos?: any, callback?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void;
/**
* cut a node (a later call to `paste(obj)` would move the node)