fixed jQuery dprecations
This commit is contained in:
dist
bootstrap-editable
bootstrap3-editable
bootstrap5-editable
inputs-ext
jquery-editable
jqueryui-editable
src
editable-form
element
inputs-ext
inputs
16
dist/bootstrap-editable/js/bootstrap-editable.js
vendored
16
dist/bootstrap-editable/js/bootstrap-editable.js
vendored
@ -521,7 +521,7 @@ Editableform is linked with one of input types, e.g. 'text', 'select' etc.
|
||||
@default null
|
||||
@example
|
||||
validate: function(value) {
|
||||
if($.trim(value) == '') {
|
||||
if(value.trim() == '') {
|
||||
return 'This field is required';
|
||||
}
|
||||
}
|
||||
@ -1502,7 +1502,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
|
||||
//set value from settings or by element's text
|
||||
if (this.options.value === undefined || this.options.value === null) {
|
||||
this.value = this.input.html2value($.trim(this.$element.html()));
|
||||
this.value = this.input.html2value(this.$element.html().trim());
|
||||
isValueByText = true;
|
||||
} else {
|
||||
/*
|
||||
@ -1564,7 +1564,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
break;
|
||||
case 'auto':
|
||||
//if element text is empty and value is defined and value not generated by text --> run autotext
|
||||
doAutotext = !$.trim(this.$element.text()).length && this.value !== null && this.value !== undefined && !isValueByText;
|
||||
doAutotext = !(this.$element.text().trim()).length && this.value !== null && this.value !== undefined && !isValueByText;
|
||||
break;
|
||||
default:
|
||||
doAutotext = false;
|
||||
@ -1696,7 +1696,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
//set option(s) by object
|
||||
if(key && typeof key === 'object') {
|
||||
$.each(key, $.proxy(function(k, v){
|
||||
this.option($.trim(k), v);
|
||||
this.option(k.triim(), v);
|
||||
}, this));
|
||||
return;
|
||||
}
|
||||
@ -1749,7 +1749,7 @@ Makes editable any HTML element on the page. Applied as jQuery method.
|
||||
if(typeof(this.input.isEmpty) === 'function') {
|
||||
this.isEmpty = this.input.isEmpty(this.$element);
|
||||
} else {
|
||||
this.isEmpty = $.trim(this.$element.html()) === '';
|
||||
this.isEmpty = this.$element.html().trim() === '';
|
||||
}
|
||||
}
|
||||
|
||||
@ -2371,7 +2371,7 @@ To create your own input you can inherit from this class.
|
||||
@param {DOMElement} element
|
||||
**/
|
||||
value2html: function(value, element) {
|
||||
$(element)[this.options.escape ? 'text' : 'html']($.trim(value));
|
||||
$(element)[this.options.escape ? 'text' : 'html'](value.trim());
|
||||
},
|
||||
|
||||
/**
|
||||
@ -3282,7 +3282,7 @@ $(function(){
|
||||
str2value: function(str) {
|
||||
var reg, value = null;
|
||||
if(typeof str === 'string' && str.length) {
|
||||
reg = new RegExp('\\s*'+$.trim(this.options.separator)+'\\s*');
|
||||
reg = new RegExp('\\s*'+this.options.separator.trim()+'\\s*');
|
||||
value = str.split(reg);
|
||||
} else if(Array.isArray(str)) {
|
||||
value = str;
|
||||
@ -3856,7 +3856,7 @@ $(function(){
|
||||
}
|
||||
val = str.split(separator);
|
||||
for (i = 0, l = val.length; i < l; i = i + 1) {
|
||||
val[i] = $.trim(val[i]);
|
||||
val[i] = val[i].trim();
|
||||
}
|
||||
|
||||
return val;
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user