fixed jQuer dprecations

This commit is contained in:
Micha
2025-03-03 11:56:17 +01:00
parent 2d450fe257
commit 323de3b9e3
24 changed files with 6951 additions and 1299 deletions

View File

@@ -70,7 +70,7 @@ List - abstract class for inputs that have source option loaded from js array or
}
//if allready loaded just call success
if(this.options.sourceCache && $.isArray(this.sourceData)) {
if(this.options.sourceCache && Array.isArray(this.sourceData)) {
success.call(this);
return;
}
@@ -162,7 +162,7 @@ List - abstract class for inputs that have source option loaded from js array or
} else { //options as json/array
this.sourceData = this.makeArray(source);
if($.isArray(this.sourceData)) {
if(Array.isArray(this.sourceData)) {
this.doPrepend();
success.call(this);
} else {
@@ -221,7 +221,7 @@ List - abstract class for inputs that have source option loaded from js array or
return null;
}
if($.isArray(data)) { //array
if(Array.isArray(data)) { //array
/*
function to iterate inside item of array if item is object.
Caclulates count of keys in item and store in obj.

View File

@@ -476,7 +476,7 @@ the specific language governing permissions and limitations under the Apache Lic
tmp,
text = function (item) { return ""+item.text; }; // function used to retrieve the text portion of a data item that is matched against the search
if ($.isArray(data)) {
if (Array.isArray(data)) {
tmp = data;
data = { results: tmp };
}
@@ -909,7 +909,7 @@ the specific language governing permissions and limitations under the Apache Lic
opts.id = function (e) { return e[idKey]; };
}
if ($.isArray(opts.element.data("select2Tags"))) {
if (Array.isArray(opts.element.data("select2Tags"))) {
if ("tags" in opts) {
throw "tags specified as both an attribute 'data-select2-tags' and in options of Select2 " + opts.element.attr("id");
}
@@ -1586,7 +1586,7 @@ the specific language governing permissions and limitations under the Apache Lic
var maxSelSize = this.getMaximumSelectionSize();
if (maxSelSize >=1) {
data = this.data();
if ($.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
if (Array.isArray(data) && data.length >= maxSelSize && checkFormatter(opts.formatSelectionTooBig, "formatSelectionTooBig")) {
render("<li class='select2-selection-limit'>" + opts.formatSelectionTooBig(maxSelSize) + "</li>");
return;
}