From 2773ff5fb820af23f6f9a853ea801da7dd7a83f9 Mon Sep 17 00:00:00 2001 From: AdaskoTheBeAsT Date: Sat, 11 Oct 2014 14:56:31 +0200 Subject: [PATCH 1/2] move_node copy_node fixed move_node copy_node fixed --- jstree/jstree-tests.ts | 5 +++++ jstree/jstree.d.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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) From 2692538517b85242735868764275ab7a62a8da75 Mon Sep 17 00:00:00 2001 From: AdaskoTheBeAsT Date: Sun, 12 Oct 2014 12:19:25 +0200 Subject: [PATCH 2/2] copy_node move_node comments fixed copy_node move_node comments fixed --- jstree/jstree.d.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 70b20ecff..5d4be29bf 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1003,8 +1003,8 @@ 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} internal parameter indicating if the tree should be redrawn + * @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?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void; @@ -1016,8 +1016,8 @@ 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} internal parameter indicating if the tree should be redrawn + * @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?: (node: any, new_par: any, pos: any) => void, is_loaded?: boolean, skip_redraw?: boolean) => void;