From 9bd4a326b5352c38da0e7e7f43ca3707349214e2 Mon Sep 17 00:00:00 2001 From: Oliver Friedrich Date: Thu, 8 Oct 2020 12:32:49 +0200 Subject: [PATCH 1/5] replace deprecated JQuery.isFunction() call for JQuery >= 3.3 --- src/javascripts/jquery.selectBoxIt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/javascripts/jquery.selectBoxIt.js b/src/javascripts/jquery.selectBoxIt.js index ebc9764..13e575b 100644 --- a/src/javascripts/jquery.selectBoxIt.js +++ b/src/javascripts/jquery.selectBoxIt.js @@ -823,7 +823,7 @@ var self = this; // Checks to make sure the parameter passed in is a function - if ($.isFunction(callback)) { + if (typeof callback === "function") { // Calls the method passed in as a parameter and sets the current `SelectBoxIt` object that is stored in the jQuery data method as the context(allows for `this` to reference the SelectBoxIt API Methods in the callback function. The `dropdown` DOM element that acts as the new dropdown list is also passed as the only parameter to the callback callback.call(self, self.dropdown); @@ -1972,7 +1972,7 @@ var self = this; - data = $.isFunction(data) ? data.call() : data; + data = (typeof data === "function") ? data.call() : data; if(self.isDeferred(data)) { From b38df7cfdd9be18fec8ed655ca00368365f54c52 Mon Sep 17 00:00:00 2001 From: Oliver Friedrich Date: Thu, 8 Oct 2020 12:45:42 +0200 Subject: [PATCH 2/5] replace deprecated JQuery.isFunction() call for JQuery >= 3.3 --- src/javascripts/modules/jquery.selectBoxIt.add.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascripts/modules/jquery.selectBoxIt.add.js b/src/javascripts/modules/jquery.selectBoxIt.add.js index 2329b33..55f9004 100644 --- a/src/javascripts/modules/jquery.selectBoxIt.add.js +++ b/src/javascripts/modules/jquery.selectBoxIt.add.js @@ -159,7 +159,7 @@ var self = this; - data = $.isFunction(data) ? data.call() : data; + data = (typeof data === "function") ? data.call() : data; if(self.isDeferred(data)) { From 2d24241b7a2b90525a6c806e02cb83a53f7d7d0b Mon Sep 17 00:00:00 2001 From: Oliver Friedrich Date: Thu, 8 Oct 2020 12:49:50 +0200 Subject: [PATCH 3/5] replace deprecated JQuery.isFunction() call for JQuery >= 3.3 --- src/javascripts/modules/jquery.selectBoxIt.core.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/javascripts/modules/jquery.selectBoxIt.core.js b/src/javascripts/modules/jquery.selectBoxIt.core.js index cb0b434..8221d46 100755 --- a/src/javascripts/modules/jquery.selectBoxIt.core.js +++ b/src/javascripts/modules/jquery.selectBoxIt.core.js @@ -823,7 +823,7 @@ var self = this; // Checks to make sure the parameter passed in is a function - if ($.isFunction(callback)) { + if (typeof callback === "function") { // Calls the method passed in as a parameter and sets the current `SelectBoxIt` object that is stored in the jQuery data method as the context(allows for `this` to reference the SelectBoxIt API Methods in the callback function. The `dropdown` DOM element that acts as the new dropdown list is also passed as the only parameter to the callback callback.call(self, self.dropdown); From d162570bbab4aa747aef916283c028e791664f9c Mon Sep 17 00:00:00 2001 From: Oliver Friedrich Date: Thu, 8 Oct 2020 15:15:56 +0200 Subject: [PATCH 4/5] Replace deprecated functions --- src/javascripts/jquery.selectBoxIt.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/javascripts/jquery.selectBoxIt.js b/src/javascripts/jquery.selectBoxIt.js index 13e575b..c2e18fb 100644 --- a/src/javascripts/jquery.selectBoxIt.js +++ b/src/javascripts/jquery.selectBoxIt.js @@ -730,7 +730,7 @@ }); - if($.type(listSize) === "number") { + if(typeof listSize === "number") { // Stores the new `max-height` for later self.maxHeight = self.listAnchors.outerHeight(true) * listSize; @@ -1826,7 +1826,7 @@ this._populate(data, function(data) { var self = this, - dataType = $.type(data), + dataType = typeof data, value, x = 0, dataLength, @@ -1835,7 +1835,7 @@ parsedJSON = isJSON && self._parseJSON(data); // If the passed data is a local or JSON array - if(data && (dataType === "array" || (isJSON && parsedJSON.data && $.type(parsedJSON.data) === "array")) || (dataType === "object" && data.data && $.type(data.data) === "array")) { + if(data && (dataType === "array" || (isJSON && parsedJSON.data && (typeof parsedJSON.data === "array"))) || (dataType === "object" && data.data && (typeof data.data === "array"))) { // If the data is JSON if(self._isJSON(data)) { @@ -1868,7 +1868,7 @@ } // If the currently traversed array item is a string - else if($.type(value) === "string") { + else if(typeof value === "string") { // Adds an option to the elems array elems.push($("