From ef080f1782406829ab94561d751e3b66604ec1c2 Mon Sep 17 00:00:00 2001 From: AdaskoTheBeAsT Date: Sat, 27 Sep 2014 13:59:35 +0200 Subject: [PATCH] Changed signature of functions: search, redraw_node Changed signature of functions: search, redraw_node --- jstree/jstree-tests.ts | 6 ++++++ jstree/jstree.d.ts | 21 ++++++++++++++------- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/jstree/jstree-tests.ts b/jstree/jstree-tests.ts index ce82807218..aa834e6217 100644 --- a/jstree/jstree-tests.ts +++ b/jstree/jstree-tests.ts @@ -69,6 +69,12 @@ var advancedTree = $("#briefcasetree").jstree({ var a = $('a').jstree(); +// test search node +a.search('test', false, true); + +//test redraw node +a.redraw_node($('#node1'), false, false, false); + //tree with new unique plugin parameters var treeWithUnique = $('#treeWithUnique').jstree({ diff --git a/jstree/jstree.d.ts b/jstree/jstree.d.ts index 10eff8d759..f6cc140693 100644 --- a/jstree/jstree.d.ts +++ b/jstree/jstree.d.ts @@ -1,4 +1,4 @@ -// Type definitions for jsTree v3.0.3 +// Type definitions for jsTree v3.0.4 // Project: http://www.jstree.com/ // Definitions by: Adam Pluciński // Definitions: https://github.com/borisyankov/DefinitelyTyped @@ -555,10 +555,9 @@ interface JSTreeStaticDefaultsSearch { case_sensitive: boolean; /** - * Indicates if the tree should be filtered to show only matching nodes - * (keep in mind this can be a heavy on large trees in old browsers). Default is `false`. - * @name $.jstree.defaults.search.show_only_matches - * @plugin search + * Indicates if the tree should be filtered (by default) to show only matching nodes + * (keep in mind this can be a heavy on large trees in old browsers). + * This setting can be changed at runtime when calling the search method. Default is `false`. */ show_only_matches: boolean; @@ -1183,8 +1182,15 @@ interface JSTree extends JQuery { show_icon: (obj: any) => void; /** + * redraws a single node. Used internally. + * @private + * @name redraw_node(node, deep, is_callback) + * @param {mixed} node the node to redraw + * @param {Boolean} deep should child nodes be redrawn too + * @param {Boolean} is_callback is this a recursion call + * @param {Boolean} force_render should children of closed parents be drawn anyway */ - redraw_node: (obj: any, deep: boolean, is_callback: boolean) => any; + redraw_node: (obj: any, deep?: boolean, is_callback?: boolean, force_render?: boolean) => any; /** * show the node checkbox icons @@ -1308,10 +1314,11 @@ interface JSTree extends JQuery { * @name search(str [, skip_async]) * @param {String} str the search string * @param {Boolean} skip_async if set to true server will not be queried even if configured + * @param {Boolean} show_only_matches if set to true only matching nodes will be shown (keep in mind this can be very slow on large trees or old browsers) * @plugin search * @trigger search.jstree */ - search: (str: string, skip_async?: boolean) => void; + search: (str: string, skip_async?: boolean, show_only_matches?: boolean) => void; /** * used to clear the last search (removes classes and shows all nodes if filtering is on)