From 8fb57dbb8e27959dcf59e6c556e755d800324d28 Mon Sep 17 00:00:00 2001 From: akasima Date: Sat, 16 Aug 2014 12:07:41 +0900 Subject: [PATCH] #913 replace to addBack() because andSelf() deprecated --- modules/admin/tpl/js/jquery.jstree.js | 42 +++++++++++++-------------- modules/menu/tpl/js/jquery.jstree.js | 42 +++++++++++++-------------- 2 files changed, 42 insertions(+), 42 deletions(-) diff --git a/modules/admin/tpl/js/jquery.jstree.js b/modules/admin/tpl/js/jquery.jstree.js index 67813474d..35cb97856 100644 --- a/modules/admin/tpl/js/jquery.jstree.js +++ b/modules/admin/tpl/js/jquery.jstree.js @@ -435,7 +435,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) @@ -678,7 +678,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; @@ -694,12 +694,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)") @@ -922,7 +922,7 @@ if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; } 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; }, @@ -941,7 +941,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; } }); } @@ -1138,7 +1138,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 () { @@ -1242,7 +1242,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); }); } @@ -2800,7 +2800,7 @@ obj.each(function () { t = $(this); c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked"; - t.find("li").andSelf().each(function () { + t.find("li").addBack().each(function () { var $t = $(this), nm; $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend(" ").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c ); if(rc) { @@ -2844,13 +2844,13 @@ } else { if(state) { - coll = obj.find("li").andSelf(); + coll = obj.find("li").addBack(); if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; } coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); if(rc) { coll.children(":checkbox").removeAttr("checked"); } } else { - coll = obj.find("li").andSelf(); + coll = obj.find("li").addBack(); if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; } coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); if(rc) { coll.children(":checkbox").attr("checked","checked"); } @@ -2861,8 +2861,8 @@ var $this = $(this); if(state) { if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) { - $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } return false; } else { @@ -2872,8 +2872,8 @@ } else { if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) { - $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } return false; } else { @@ -2944,8 +2944,8 @@ else if(a === 0 && b === 0) { this.change_state(obj, true); } else if(a === c) { this.change_state(obj, false); } else { - obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } } }, reselect : function () { @@ -3415,7 +3415,7 @@ this.get_container() .bind("search.jstree", function (e, data) { $(this).children("ul").find("li").hide().removeClass("jstree-last"); - data.rslt.nodes.parentsUntil(".jstree").andSelf().show() + data.rslt.nodes.parentsUntil(".jstree").addBack().show() .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); }); }) .bind("clear_search.jstree", function () { @@ -4001,7 +4001,7 @@ // this used to use html() and clean the whitespace, but this way any attached data was lost this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true); // remove white space from LI node - otherwise nodes appear a bit to the right - this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove(); + this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove(); }, defaults : { data : false, @@ -4427,7 +4427,7 @@ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj); if(obj === false) { return; } // added for removing root nodes obj.each(function () { - $(this).find("li").andSelf().each(function () { + $(this).find("li").addBack().each(function () { var $t = $(this); if($t.children(".jstree-wholerow-span").length) { return true; } $t.prepend(" "); @@ -4542,4 +4542,4 @@ })(jQuery); //*/ -})(); \ No newline at end of file +})(); diff --git a/modules/menu/tpl/js/jquery.jstree.js b/modules/menu/tpl/js/jquery.jstree.js index 67813474d..35cb97856 100644 --- a/modules/menu/tpl/js/jquery.jstree.js +++ b/modules/menu/tpl/js/jquery.jstree.js @@ -435,7 +435,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) @@ -678,7 +678,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; @@ -694,12 +694,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)") @@ -922,7 +922,7 @@ if(!obj || !obj.o || obj.or[0] === obj.o[0]) { return false; } 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; }, @@ -941,7 +941,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; } }); } @@ -1138,7 +1138,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 () { @@ -1242,7 +1242,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); }); } @@ -2800,7 +2800,7 @@ obj.each(function () { t = $(this); c = t.is("li") && (t.hasClass("jstree-checked") || (rc && t.children(":checked").length)) ? "jstree-checked" : "jstree-unchecked"; - t.find("li").andSelf().each(function () { + t.find("li").addBack().each(function () { var $t = $(this), nm; $t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend(" ").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c ); if(rc) { @@ -2844,13 +2844,13 @@ } else { if(state) { - coll = obj.find("li").andSelf(); + coll = obj.find("li").addBack(); if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; } coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked"); if(rc) { coll.children(":checkbox").removeAttr("checked"); } } else { - coll = obj.find("li").andSelf(); + coll = obj.find("li").addBack(); if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; } coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked"); if(rc) { coll.children(":checkbox").attr("checked","checked"); } @@ -2861,8 +2861,8 @@ var $this = $(this); if(state) { if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) { - $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } return false; } else { @@ -2872,8 +2872,8 @@ } else { if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) { - $this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + $this.parentsUntil(".jstree", "li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { $this.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } return false; } else { @@ -2944,8 +2944,8 @@ else if(a === 0 && b === 0) { this.change_state(obj, true); } else if(a === c) { this.change_state(obj, false); } else { - obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); - if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").removeAttr("checked"); } + obj.parentsUntil(".jstree","li").addBack().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined"); + if(rc) { obj.parentsUntil(".jstree", "li").addBack().children(":checkbox").removeAttr("checked"); } } }, reselect : function () { @@ -3415,7 +3415,7 @@ this.get_container() .bind("search.jstree", function (e, data) { $(this).children("ul").find("li").hide().removeClass("jstree-last"); - data.rslt.nodes.parentsUntil(".jstree").andSelf().show() + data.rslt.nodes.parentsUntil(".jstree").addBack().show() .filter("ul").each(function () { $(this).children("li:visible").eq(-1).addClass("jstree-last"); }); }) .bind("clear_search.jstree", function () { @@ -4001,7 +4001,7 @@ // this used to use html() and clean the whitespace, but this way any attached data was lost this.data.html_data.original_container_html = this.get_container().find(" > ul > li").clone(true); // remove white space from LI node - otherwise nodes appear a bit to the right - this.data.html_data.original_container_html.find("li").andSelf().contents().filter(function() { return this.nodeType == 3; }).remove(); + this.data.html_data.original_container_html.find("li").addBack().contents().filter(function() { return this.nodeType == 3; }).remove(); }, defaults : { data : false, @@ -4427,7 +4427,7 @@ obj = !obj || obj == -1 ? this.get_container().find("> ul > li") : this._get_node(obj); if(obj === false) { return; } // added for removing root nodes obj.each(function () { - $(this).find("li").andSelf().each(function () { + $(this).find("li").addBack().each(function () { var $t = $(this); if($t.children(".jstree-wholerow-span").length) { return true; } $t.prepend(" "); @@ -4542,4 +4542,4 @@ })(jQuery); //*/ -})(); \ No newline at end of file +})();