fixed jQuery dprecations
This commit is contained in:
parent
d0d10a7e90
commit
30f1b9a6a9
dist
bootstrap-editable/js
bootstrap3-editable/js
bootstrap5-editable/js
inputs-ext/typeaheadjs/lib
jquery-editable/js
jqueryui-editable/js
src
@ -2601,7 +2601,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -2718,7 +2718,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -2601,7 +2601,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -2718,7 +2718,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -2601,7 +2601,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -2718,7 +2718,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
4
dist/inputs-ext/typeaheadjs/lib/typeahead.js
vendored
4
dist/inputs-ext/typeaheadjs/lib/typeahead.js
vendored
@ -24,7 +24,7 @@
|
||||
return typeof obj === "number";
|
||||
},
|
||||
isArray: Array.isArray,
|
||||
isFunction: $.isFunction,
|
||||
isFunction: (object) => typeof object === "function" && typeof object.call === "function",
|
||||
isObject: $.isPlainObject,
|
||||
isUndefined: function(obj) {
|
||||
return typeof obj === "undefined";
|
||||
@ -33,7 +33,7 @@
|
||||
bindAll: function(obj) {
|
||||
var val;
|
||||
for (var key in obj) {
|
||||
$.isFunction(val = obj[key]) && (obj[key] = $.proxy(val, obj));
|
||||
typeof(val = obj[key]) === 'function' && (obj[key] = $.proxy(val, obj));
|
||||
}
|
||||
},
|
||||
indexOf: function(haystack, needle) {
|
||||
|
@ -2601,7 +2601,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -2718,7 +2718,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -2601,7 +2601,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -2718,7 +2718,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
@ -3695,7 +3695,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@
|
||||
return typeof obj === "number";
|
||||
},
|
||||
isArray: Array.isArray,
|
||||
isFunction: $.isFunction,
|
||||
isFunction: (object) => typeof object === "function" && typeof object.call === "function",
|
||||
isObject: $.isPlainObject,
|
||||
isUndefined: function(obj) {
|
||||
return typeof obj === "undefined";
|
||||
@ -33,7 +33,7 @@
|
||||
bindAll: function(obj) {
|
||||
var val;
|
||||
for (var key in obj) {
|
||||
$.isFunction(val = obj[key]) && (obj[key] = $.proxy(val, obj));
|
||||
typeof(val = obj[key]) === 'function' && (obj[key] = $.proxy(val, obj));
|
||||
}
|
||||
},
|
||||
indexOf: function(haystack, needle) {
|
||||
|
@ -61,7 +61,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
onSourceReady: function (success, error) {
|
||||
//run source if it function
|
||||
var source;
|
||||
if ($.isFunction(this.options.source)) {
|
||||
if (typeof(this.options.source) === 'function') {
|
||||
source = this.options.source.call(this.options.scope);
|
||||
this.sourceData = null;
|
||||
//note: if function returns the same source as URL - sourceData will be taken from cahce and no extra request performed
|
||||
@ -178,7 +178,7 @@ List - abstract class for inputs that have source option loaded from js array or
|
||||
|
||||
if(!Array.isArray(this.prependData)) {
|
||||
//run prepend if it is function (once)
|
||||
if ($.isFunction(this.options.prepend)) {
|
||||
if (typeof (this.options.prepend) === 'function') {
|
||||
this.options.prepend = this.options.prepend.call(this.options.scope);
|
||||
}
|
||||
|
||||
|
22
src/inputs/select2/lib/select2.js
vendored
22
src/inputs/select2/lib/select2.js
vendored
@ -434,7 +434,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
if (handler) { handler.abort(); }
|
||||
|
||||
if (options.params) {
|
||||
if ($.isFunction(options.params)) {
|
||||
if (typeof (options.params) === 'function') {
|
||||
$.extend(params, options.params.call(self));
|
||||
} else {
|
||||
$.extend(params, options.params);
|
||||
@ -481,7 +481,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
data = { results: tmp };
|
||||
}
|
||||
|
||||
if ($.isFunction(data) === false) {
|
||||
if (typeof (data) !== 'function') {
|
||||
tmp = data;
|
||||
data = function() { return tmp; };
|
||||
}
|
||||
@ -490,7 +490,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
if (dataItem.text) {
|
||||
text = dataItem.text;
|
||||
// if text is not a function we assume it to be a key name
|
||||
if (!$.isFunction(text)) {
|
||||
if (!typeof(text) === 'function') {
|
||||
dataText = dataItem.text; // we need to store this in a separate variable because in the next step data gets reset and data.text is no longer available
|
||||
text = function (item) { return item[dataText]; };
|
||||
}
|
||||
@ -530,7 +530,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
|
||||
// TODO javadoc
|
||||
function tags(data) {
|
||||
var isFunc = $.isFunction(data);
|
||||
var isFunc = typeof (data) === 'function';
|
||||
return function (query) {
|
||||
var t = query.term, filtered = {results: []};
|
||||
$(isFunc ? data() : data).each(function () {
|
||||
@ -553,13 +553,13 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
* @param formatter
|
||||
*/
|
||||
function checkFormatter(formatter, formatterName) {
|
||||
if ($.isFunction(formatter)) return true;
|
||||
if (typeof (formatter) === 'function') return true;
|
||||
if (!formatter) return false;
|
||||
throw new Error(formatterName +" must be a function or a falsy value");
|
||||
}
|
||||
|
||||
function evaluate(val) {
|
||||
return $.isFunction(val) ? val() : val;
|
||||
return typeof (val) === 'function' ? val() : val;
|
||||
}
|
||||
|
||||
function countResults(results) {
|
||||
@ -754,7 +754,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
// dom it will trigger the popup close, which is not what we want
|
||||
this.dropdown.on("click mouseup mousedown", function (e) { e.stopPropagation(); });
|
||||
|
||||
if ($.isFunction(this.opts.initSelection)) {
|
||||
if (typeof (this.opts.initSelection) === 'function') {
|
||||
// initialize selection based on the current value of the source element
|
||||
this.initSelection();
|
||||
|
||||
@ -976,7 +976,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
$(splitVal(element.val(), opts.separator)).each(function () {
|
||||
var obj = { id: this, text: this },
|
||||
tags = opts.tags;
|
||||
if ($.isFunction(tags)) tags=tags();
|
||||
if (typeof (tags) === 'function') tags=tags();
|
||||
$(tags).each(function() { if (equal(this.id, obj.id)) { obj = this; return false; } });
|
||||
data.push(obj);
|
||||
});
|
||||
@ -1785,7 +1785,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
}
|
||||
|
||||
return null;
|
||||
} else if ($.isFunction(this.opts.width)) {
|
||||
} else if (typeof(this.opts.width) === 'function') {
|
||||
return this.opts.width();
|
||||
} else {
|
||||
return this.opts.width;
|
||||
@ -2151,7 +2151,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
}
|
||||
return is_match;
|
||||
},
|
||||
callback: !$.isFunction(callback) ? $.noop : function() {
|
||||
callback: !typeof(callback) === 'function' ? $.noop : function() {
|
||||
callback(match);
|
||||
}
|
||||
});
|
||||
@ -2419,7 +2419,7 @@ the specific language governing permissions and limitations under the Apache Lic
|
||||
}
|
||||
return is_match;
|
||||
},
|
||||
callback: !$.isFunction(callback) ? $.noop : function() {
|
||||
callback: !typeof(callback) === 'function' ? $.noop : function() {
|
||||
// reorder matches based on the order they appear in the ids array because right now
|
||||
// they are in the order in which they appear in data array
|
||||
var ordered = [];
|
||||
|
2
src/inputs/select2/select2.js
vendored
2
src/inputs/select2/select2.js
vendored
@ -98,7 +98,7 @@ $(function(){
|
||||
if(!options.select2.tags && options.source) {
|
||||
var source = options.source;
|
||||
//if source is function, call it (once!)
|
||||
if ($.isFunction(options.source)) {
|
||||
if (typeof (options.source) === 'function') {
|
||||
source = options.source.call(options.scope);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user