diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index e059589a6..f8bcb7de1 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -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); + diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 689232104..70b20ecff 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1004,9 +1004,10 @@ interface JSTree extends JQuery { * @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} 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 @@ -1016,9 +1017,10 @@ interface JSTree extends JQuery { * @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} 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)