Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 48273e4

Browse files
committed
Merge pull request #4026 from adobe/dangoor/jquery-deprecations
Fix jQuery 1.8 deprecations
2 parents ae950bd + 9313e0a commit 48273e4

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

src/thirdparty/jstree_pre1.0_fix_1/jquery.jstree.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -570,10 +570,10 @@
570570
obj = this._get_node(obj);
571571
if(obj === -1) { return this.get_container().find("> ul > li:first-child"); }
572572
if(!obj.length) { return false; }
573-
if(strict) { return (obj.nextAll("li").size() > 0) ? obj.nextAll("li:eq(0)") : false; }
573+
if(strict) { return (obj.nextAll("li").length > 0) ? obj.nextAll("li:eq(0)") : false; }
574574

575575
if(obj.hasClass("jstree-open")) { return obj.find("li:eq(0)"); }
576-
else if(obj.nextAll("li").size() > 0) { return obj.nextAll("li:eq(0)"); }
576+
else if(obj.nextAll("li").length > 0) { return obj.nextAll("li:eq(0)"); }
577577
else { return obj.parentsUntil(".jstree","li").next("li").eq(0); }
578578
},
579579
_get_prev : function (obj, strict) {
@@ -1961,7 +1961,7 @@
19611961
},
19621962
get_text : function (obj, lang) {
19631963
obj = this._get_node(obj) || this.data.ui.last_selected;
1964-
if(!obj.size()) { return false; }
1964+
if(!obj.length) { return false; }
19651965
var langs = this._get_settings().languages,
19661966
s = this._get_settings().core.html_titles;
19671967
if($.isArray(langs) && langs.length) {
@@ -1981,7 +1981,7 @@
19811981
},
19821982
set_text : function (obj, val, lang) {
19831983
obj = this._get_node(obj) || this.data.ui.last_selected;
1984-
if(!obj.size()) { return false; }
1984+
if(!obj.length) { return false; }
19851985
var langs = this._get_settings().languages,
19861986
s = this._get_settings().core.html_titles,
19871987
tmp;
@@ -2800,22 +2800,22 @@
28002800
var $t = $(this), nm;
28012801
$t.children("a" + (_this.data.languages ? "" : ":eq(0)") ).not(":has(.jstree-checkbox)").prepend("<ins class='jstree-checkbox'>&#160;</ins>").parent().not(".jstree-checked, .jstree-unchecked").addClass( ts ? "jstree-unchecked" : c );
28022802
if(rc) {
2803-
if(!$t.children(":checkbox").length) {
2803+
if(!$t.children("[type=checkbox]").length) {
28042804
nm = rcn.call(_this, $t);
28052805
$t.prepend("<input type='checkbox' class='jstree-real-checkbox' id='" + nm[0] + "' name='" + nm[0] + "' value='" + nm[1] + "' />");
28062806
}
28072807
else {
2808-
$t.children(":checkbox").addClass("jstree-real-checkbox");
2808+
$t.children("[type=checkbox]").addClass("jstree-real-checkbox");
28092809
}
28102810
}
28112811
if(!ts) {
28122812
if(c === "jstree-checked" || $t.hasClass("jstree-checked") || $t.children(':checked').length) {
2813-
$t.find("li").andSelf().addClass("jstree-checked").children(":checkbox").prop("checked", true);
2813+
$t.find("li").andSelf().addClass("jstree-checked").children("[type=checkbox]").prop("checked", true);
28142814
}
28152815
}
28162816
else {
28172817
if($t.hasClass("jstree-checked") || $t.children(':checked').length) {
2818-
$t.addClass("jstree-checked").children(":checkbox").prop("checked", true);
2818+
$t.addClass("jstree-checked").children("[type=checkbox]").prop("checked", true);
28192819
}
28202820
}
28212821
});
@@ -2832,25 +2832,25 @@
28322832
if(this._get_settings().checkbox.two_state) {
28332833
if(state) {
28342834
obj.removeClass("jstree-checked").addClass("jstree-unchecked");
2835-
if(rc) { obj.children(":checkbox").prop("checked", false); }
2835+
if(rc) { obj.children("[type=checkbox]").prop("checked", false); }
28362836
}
28372837
else {
28382838
obj.removeClass("jstree-unchecked").addClass("jstree-checked");
2839-
if(rc) { obj.children(":checkbox").prop("checked", true); }
2839+
if(rc) { obj.children("[type=checkbox]").prop("checked", true); }
28402840
}
28412841
}
28422842
else {
28432843
if(state) {
28442844
coll = obj.find("li").andSelf();
28452845
if(!coll.filter(".jstree-checked, .jstree-undetermined").length) { return false; }
28462846
coll.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
2847-
if(rc) { coll.children(":checkbox").prop("checked", false); }
2847+
if(rc) { coll.children("[type=checkbox]").prop("checked", false); }
28482848
}
28492849
else {
28502850
coll = obj.find("li").andSelf();
28512851
if(!coll.filter(".jstree-unchecked, .jstree-undetermined").length) { return false; }
28522852
coll.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
2853-
if(rc) { coll.children(":checkbox").prop("checked", true); }
2853+
if(rc) { coll.children("[type=checkbox]").prop("checked", true); }
28542854
if(this.data.ui) { this.data.ui.last_selected = obj; }
28552855
this.data.checkbox.last_selected = obj;
28562856
}
@@ -2859,23 +2859,23 @@
28592859
if(state) {
28602860
if($this.children("ul").children("li.jstree-checked, li.jstree-undetermined").length) {
28612861
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2862-
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
2862+
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children("[type=checkbox]").prop("checked", false); }
28632863
return false;
28642864
}
28652865
else {
28662866
$this.removeClass("jstree-checked jstree-undetermined").addClass("jstree-unchecked");
2867-
if(rc) { $this.children(":checkbox").prop("checked", false); }
2867+
if(rc) { $this.children("[type=checkbox]").prop("checked", false); }
28682868
}
28692869
}
28702870
else {
28712871
if($this.children("ul").children("li.jstree-unchecked, li.jstree-undetermined").length) {
28722872
$this.parentsUntil(".jstree", "li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2873-
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
2873+
if(rc) { $this.parentsUntil(".jstree", "li").andSelf().children("[type=checkbox]").prop("checked", false); }
28742874
return false;
28752875
}
28762876
else {
28772877
$this.removeClass("jstree-unchecked jstree-undetermined").addClass("jstree-checked");
2878-
if(rc) { $this.children(":checkbox").prop("checked", true); }
2878+
if(rc) { $this.children("[type=checkbox]").prop("checked", true); }
28792879
}
28802880
}
28812881
});
@@ -2934,7 +2934,7 @@
29342934
obj = this._get_node(obj);
29352935
if(!obj.length) { return; }
29362936
if(this._get_settings().checkbox.two_state) {
2937-
obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children(':checkbox').prop('checked', true);
2937+
obj.find('li').andSelf().not('.jstree-checked').removeClass('jstree-undetermined').addClass('jstree-unchecked').children("[type=checkbox]").prop('checked', true);
29382938
return;
29392939
}
29402940
var rc = this._get_settings().checkbox.real_checkboxes,
@@ -2946,7 +2946,7 @@
29462946
else if(a === c) { this.change_state(obj, false); }
29472947
else {
29482948
obj.parentsUntil(".jstree","li").andSelf().removeClass("jstree-checked jstree-unchecked").addClass("jstree-undetermined");
2949-
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children(":checkbox").prop("checked", false); }
2949+
if(rc) { obj.parentsUntil(".jstree", "li").andSelf().children("[type=checkbox]").prop("checked", false); }
29502950
}
29512951
},
29522952
reselect : function () {
@@ -3186,7 +3186,7 @@
31863186
_is_loaded : function (obj) {
31873187
var s = this._get_settings().xml_data;
31883188
obj = this._get_node(obj);
3189-
return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
3189+
return obj == -1 || !obj || (!s.ajax && !$.isFunction(s.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
31903190
},
31913191
load_node_xml : function (obj, s_call, e_call) {
31923192
var s = this.get_settings().xml_data,
@@ -4013,7 +4013,7 @@
40134013
load_node : function (obj, s_call, e_call) { var _this = this; this.load_node_html(obj, function () { _this.__callback({ "obj" : _this._get_node(obj) }); s_call.call(this); }, e_call); },
40144014
_is_loaded : function (obj) {
40154015
obj = this._get_node(obj);
4016-
return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").size() > 0;
4016+
return obj == -1 || !obj || (!this._get_settings().html_data.ajax && !$.isFunction(this._get_settings().html_data.data)) || obj.is(".jstree-open, .jstree-leaf") || obj.children("ul").children("li").length > 0;
40174017
},
40184018
load_node_html : function (obj, s_call, e_call) {
40194019
var d,

test/thirdparty/jasmine-jquery-1.3.1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jasmine.JQuery.matchersClass = {};
175175
},
176176

177177
toExist: function() {
178-
return this.actual.size() > 0;
178+
return this.actual.length > 0;
179179
},
180180

181181
toHaveAttr: function(attributeName, expectedAttributeValue) {
@@ -211,7 +211,7 @@ jasmine.JQuery.matchersClass = {};
211211
},
212212

213213
toContain: function(selector) {
214-
return this.actual.find(selector).size() > 0;
214+
return this.actual.find(selector).length > 0;
215215
},
216216

217217
toBeDisabled: function(selector){

0 commit comments

Comments
 (0)