From: Moritz Bunkus Date: Wed, 22 Jan 2014 13:44:31 +0000 (+0100) Subject: jstree auf v1.0fix2 aktualisiert X-Git-Tag: release-3.2.0beta~467^2~25 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=f7551e1cfb1757c55103e5a7b9b08ced32ec4bfd;p=kivitendo-erp.git jstree auf v1.0fix2 aktualisiert Behebt das Problem, dass Items in anderer Reihenfolge angelegt wurden, als sie im »data«-Array standen. --- diff --git a/doc/js/README.jstree.txt b/doc/js/README.jstree.txt new file mode 100644 index 000000000..54e7fb74b --- /dev/null +++ b/doc/js/README.jstree.txt @@ -0,0 +1,15 @@ +To publish jstree 3.0.0 I need your opinion: +https://groups.google.com/forum/#!topic/jstree/Yabg_OLPuvQ + +******************************************************************** + +jsTree pre1.0 +http://jstree.com/ + +Copyright (c) 2011 Ivan Bozhanov (vakata.com) + +Dual licensed under the MIT and GPL licenses: + http://www.opensource.org/licenses/mit-license.php + http://www.gnu.org/licenses/gpl.html + +This is the latest stable version before switching from GoogleCode to GitHub. diff --git a/js/jquery.jstree.js b/js/jquery.jstree.js index b4aac3e85..c92c2acd6 100644 --- a/js/jquery.jstree.js +++ b/js/jquery.jstree.js @@ -436,7 +436,7 @@ .undelegate(".jstree") .removeData("jstree_instance_id") .find("[class^='jstree']") - .andSelf() + .addBack() .attr("class", function () { return this.className.replace(/jstree[^ ]*|$/ig,''); }); $(document) .unbind(".jstree-" + n) @@ -679,7 +679,7 @@ } else { original_obj = obj; - if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").andSelf(); } + if(obj.is(".jstree-closed")) { obj = obj.find("li.jstree-closed").addBack(); } else { obj = obj.find("li.jstree-closed"); } } var _this = this; @@ -695,12 +695,12 @@ var _this = this; obj = obj ? this._get_node(obj) : this.get_container(); if(!obj || obj === -1) { obj = this.get_container_ul(); } - obj.find("li.jstree-open").andSelf().each(function () { _this.close_node(this, !do_animation); }); + obj.find("li.jstree-open").addBack().each(function () { _this.close_node(this, !do_animation); }); this.__callback({ "obj" : obj }); }, clean_node : function (obj) { obj = obj && obj != -1 ? $(obj) : this.get_container_ul(); - obj = obj.is("li") ? obj.find("li").andSelf() : obj.find("li"); + obj = obj.is("li") ? obj.find("li").addBack() : obj.find("li"); obj.removeClass("jstree-last") .filter("li:last-child").addClass("jstree-last").end() .filter(":has(li)") @@ -925,7 +925,7 @@ if(!obj.cy) { if(obj.op && obj.np && obj.op[0] === obj.np[0] && obj.cp - 1 === obj.o.index()) { return false; } obj.o.each(function () { - if(r.parentsUntil(".jstree", "li").andSelf().index(this) !== -1) { ret = false; return false; } + if(r.parentsUntil(".jstree", "li").addBack().index(this) !== -1) { ret = false; return false; } }); } return ret; @@ -945,7 +945,7 @@ var o = false; if(is_copy) { o = obj.o.clone(true); - o.find("*[id]").andSelf().each(function () { + o.find("*[id]").addBack().each(function () { if(this.id) { this.id = "copy_" + this.id; } }); } @@ -1142,7 +1142,7 @@ switch(!0) { case (is_range): this.data.ui.last_selected.addClass("jstree-last-selected"); - obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").andSelf(); + obj = obj[ obj.index() < this.data.ui.last_selected.index() ? "nextUntil" : "prevUntil" ](".jstree-last-selected").addBack(); if(s.select_limit == -1 || obj.length < s.select_limit) { this.data.ui.last_selected.removeClass("jstree-last-selected"); this.data.ui.selected.each(function () { @@ -1246,7 +1246,7 @@ .bind("move_node.jstree", $.proxy(function (e, data) { if(this._get_settings().crrm.move.open_onmove) { var t = this; - data.rslt.np.parentsUntil(".jstree").andSelf().filter(".jstree-closed").each(function () { + data.rslt.np.parentsUntil(".jstree").addBack().filter(".jstree-closed").each(function () { t.open_node(this, false, true); }); } @@ -1791,12 +1791,15 @@ obj.data("jstree_children", d); } if($.isArray(js)) { - d = $(); + d = $('