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

@@ -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;
}