Fixed jQuery migration plugin deprecation warning for use of .type()

This commit is contained in:
Christopher Lassen 2020-10-12 11:11:44 +02:00
parent bb372ec424
commit 06b7997e67

View File

@ -2411,7 +2411,7 @@ var datetimepickerFactory = function ($) {
} }
} }
if ($.type(options.mask) === 'string') { if (typeof options.mask === 'string') {
if (!isValidValue(options.mask, input.val())) { if (!isValidValue(options.mask, input.val())) {
input.val(options.mask.replace(/[0-9]/g, '_')); input.val(options.mask.replace(/[0-9]/g, '_'));
setCaretPos(input[0], 0); setCaretPos(input[0], 0);
@ -2644,7 +2644,7 @@ var datetimepickerFactory = function ($) {
this.each(function () { this.each(function () {
var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input; var datetimepicker = $(this).data('xdsoft_datetimepicker'), $input;
if (datetimepicker) { if (datetimepicker) {
if ($.type(opt) === 'string') { if (typeof opt === 'string') {
switch (opt) { switch (opt) {
case 'show': case 'show':
$(this).select().focus(); $(this).select().focus();
@ -2681,7 +2681,7 @@ var datetimepickerFactory = function ($) {
} }
return 0; return 0;
} }
if ($.type(opt) !== 'string') { if (typeof opt !== 'string') {
if (!options.lazyInit || options.open || options.inline) { if (!options.lazyInit || options.open || options.inline) {
createDateTimePicker($(this)); createDateTimePicker($(this));
} else { } else {