Added back select2("enable")
This also adds a console warning if the `enable` or `val` method is called.
This commit is contained in:
parent
100015b205
commit
3ff78d8145
25
dist/js/select2.amd.full.js
vendored
25
dist/js/select2.amd.full.js
vendored
@ -3750,7 +3750,32 @@ define('select2/core',[
|
||||
return this.$container.hasClass('select2-container--open');
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.prop("disabled") ' +
|
||||
'instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
args = [true];
|
||||
}
|
||||
|
||||
var disabled = !args[0];
|
||||
|
||||
this.$element.prop('disabled', disabled);
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.val() instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
return this.$element.val();
|
||||
}
|
||||
|
25
dist/js/select2.amd.js
vendored
25
dist/js/select2.amd.js
vendored
@ -3750,7 +3750,32 @@ define('select2/core',[
|
||||
return this.$container.hasClass('select2-container--open');
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.prop("disabled") ' +
|
||||
'instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
args = [true];
|
||||
}
|
||||
|
||||
var disabled = !args[0];
|
||||
|
||||
this.$element.prop('disabled', disabled);
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.val() instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
return this.$element.val();
|
||||
}
|
||||
|
25
dist/js/select2.full.js
vendored
25
dist/js/select2.full.js
vendored
@ -13285,7 +13285,32 @@ define('select2/core',[
|
||||
return this.$container.hasClass('select2-container--open');
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.prop("disabled") ' +
|
||||
'instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
args = [true];
|
||||
}
|
||||
|
||||
var disabled = !args[0];
|
||||
|
||||
this.$element.prop('disabled', disabled);
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.val() instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
return this.$element.val();
|
||||
}
|
||||
|
2
dist/js/select2.full.min.js
vendored
2
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
25
dist/js/select2.js
vendored
25
dist/js/select2.js
vendored
@ -4178,7 +4178,32 @@ define('select2/core',[
|
||||
return this.$container.hasClass('select2-container--open');
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.prop("disabled") ' +
|
||||
'instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
args = [true];
|
||||
}
|
||||
|
||||
var disabled = !args[0];
|
||||
|
||||
this.$element.prop('disabled', disabled);
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.val() instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
return this.$element.val();
|
||||
}
|
||||
|
2
dist/js/select2.min.js
vendored
2
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
25
src/js/select2/core.js
vendored
25
src/js/select2/core.js
vendored
@ -297,7 +297,32 @@ define([
|
||||
return this.$container.hasClass('select2-container--open');
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.prop("disabled") ' +
|
||||
'instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
args = [true];
|
||||
}
|
||||
|
||||
var disabled = !args[0];
|
||||
|
||||
this.$element.prop('disabled', disabled);
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("val")` method has been deprecated and will be' +
|
||||
' removed in later Select2 versions. Use $element.val() instead.'
|
||||
);
|
||||
}
|
||||
|
||||
if (args.length === 0) {
|
||||
return this.$element.val();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user