Skip to content

Commit 323e608

Browse files
authored
fix(chore): replace jquery trim with vanilla js
Replaces the used jquery trim methods by its native vanilla javascript variant. As of jquery 3.5.0 the trim method gets deprecated
1 parent 40642d3 commit 323e608

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/definitions/behaviors/form.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ $.fn.form = function(parameters) {
336336
}
337337
},
338338
blank: function($field) {
339-
return $.trim($field.val()) === '';
339+
return String($field.val()).trim() === '';
340340
},
341341
valid: function(field) {
342342
var
@@ -1264,7 +1264,7 @@ $.fn.form = function(parameters) {
12641264
// cast to string avoiding encoding special values
12651265
value = (value === undefined || value === '' || value === null)
12661266
? ''
1267-
: (settings.shouldTrim) ? $.trim(value + '') : String(value + '')
1267+
: (settings.shouldTrim) ? String(value + '').trim() : String(value + '')
12681268
;
12691269
return ruleFunction.call(field, value, ancillary, $module);
12701270
}

src/definitions/modules/dropdown.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ $.fn.dropdown = function(parameters) {
17731773
return $text.text();
17741774
},
17751775
query: function() {
1776-
return $.trim($search.val());
1776+
return String($search.val()).trim();
17771777
},
17781778
searchWidth: function(value) {
17791779
value = (value !== undefined)
@@ -1916,8 +1916,8 @@ $.fn.dropdown = function(parameters) {
19161916
return ($choice.data(metadata.text) !== undefined)
19171917
? $choice.data(metadata.text)
19181918
: (preserveHTML)
1919-
? $.trim($choice.html())
1920-
: $.trim($choice.text())
1919+
? $choice.html().trim()
1920+
: $choice.text().trim()
19211921
;
19221922
}
19231923
},
@@ -1929,11 +1929,11 @@ $.fn.dropdown = function(parameters) {
19291929
return ($choice.data(metadata.value) !== undefined)
19301930
? String( $choice.data(metadata.value) )
19311931
: (typeof choiceText === 'string')
1932-
? $.trim(
1932+
? String(
19331933
settings.ignoreSearchCase
19341934
? choiceText.toLowerCase()
19351935
: choiceText
1936-
)
1936+
).trim()
19371937
: String(choiceText)
19381938
;
19391939
},

0 commit comments

Comments
 (0)