Permalink
Browse files

Allowing success and error callbacks in refresh()

  • Loading branch information...
1 parent 135cb1c commit cae7791d146e8dcc3665cc906913045319965a30 @chillu chillu committed Mar 17, 2011
Showing with 10 additions and 2 deletions.
  1. +10 −2 thirdparty/jstree/jquery.jstree.js
View
12 thirdparty/jstree/jquery.jstree.js
@@ -524,15 +524,23 @@
}
this.__callback({});
},
- refresh : function (obj) {
+ refresh : function (obj, s_call, e_call) {
var _this = this;
this.save_opened();
if(!obj) { obj = -1; }
obj = this._get_node(obj);
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 () {

0 comments on commit cae7791

Please sign in to comment.