From 77fa855cdab748057843214dee9b3c54141dd454 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Fri, 18 Mar 2011 10:50:57 +1300 Subject: [PATCH] Allowing success and error callbacks in refresh() --- thirdparty/jstree/jquery.jstree.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/thirdparty/jstree/jquery.jstree.js b/thirdparty/jstree/jquery.jstree.js index cbc614377..b4c1efa22 100644 --- a/thirdparty/jstree/jquery.jstree.js +++ b/thirdparty/jstree/jquery.jstree.js @@ -523,7 +523,7 @@ } this.__callback({}); }, - refresh : function (obj) { + refresh : function (obj, s_call, e_call) { var _this = this; this.save_opened(); if(!obj) { obj = -1; } @@ -531,7 +531,15 @@ if(!obj) { obj = -1; } if(obj !== -1) { obj.children("UL").remove(); } else { this.get_container_ul().empty(); } - this.load_node(obj, function () { _this.__callback({ "obj" : obj}); _this.reload_nodes(); }); + this.load_node( + obj, + function () { + _this.__callback({ "obj" : obj}); + _this.reload_nodes(); + if(s_call) s_call.call(this); + }, + e_call + ); }, // Dummy function to fire after the first load (so that there is a jstree.loaded event) loaded : function () {