Added debug option
Now most of the warning messages will only be displayed if the `debug` option is set when initializing Select2. This closes https://github.com/select2/select2/issues/3100.
This commit is contained in:
parent
7feb90f256
commit
78c301f4fb
24
dist/js/select2.amd.full.js
vendored
24
dist/js/select2.amd.full.js
vendored
@ -1171,7 +1171,7 @@ define('select2/selection/allowClear',[
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
if (self.placeholder == null) {
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
console.error(
|
||||
'Select2: The `allowClear` option should be used in combination ' +
|
||||
'with the `placeholder` option.'
|
||||
@ -2782,7 +2782,7 @@ define('select2/data/ajax',[
|
||||
var $request = options.transport(options, function (data) {
|
||||
var results = self.processResults(data, params);
|
||||
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
// Check to make sure that the response included a `results` key.
|
||||
if (!results || !results.results || !$.isArray(results.results)) {
|
||||
console.error(
|
||||
@ -3963,7 +3963,7 @@ define('select2/defaults',[
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (window.console && console.warn) {
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
@ -4044,6 +4044,7 @@ define('select2/defaults',[
|
||||
amdBase: 'select2/',
|
||||
amdLanguageBase: 'select2/i18n/',
|
||||
closeOnSelect: true,
|
||||
debug: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
@ -4139,7 +4140,7 @@ define('select2/options',[
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
||||
@ -4152,7 +4153,7 @@ define('select2/options',[
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
'`data-ajax--url` and support for the old attribute will be removed' +
|
||||
@ -4617,7 +4618,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("enable")` method has been deprecated and will' +
|
||||
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
||||
@ -4635,7 +4636,8 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.data = function () {
|
||||
if (arguments.length > 0 && window.console && console.warn) {
|
||||
if (this.options.get('debug') &&
|
||||
arguments.length > 0 && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
||||
'should consider setting the value instead using `$element.val()`.'
|
||||
@ -4652,7 +4654,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.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.'
|
||||
@ -4999,7 +5001,7 @@ define('select2/compat/initSelection',[
|
||||
'jquery'
|
||||
], function ($) {
|
||||
function InitSelection (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `initSelection` option has been deprecated in favor' +
|
||||
' of a custom data adapter that overrides the `current` method. ' +
|
||||
@ -5046,7 +5048,7 @@ define('select2/compat/inputData',[
|
||||
this._valueSeparator = options.get('valueSeparator') || ',';
|
||||
|
||||
if ($element.prop('type') === 'hidden') {
|
||||
if (console && console.warn) {
|
||||
if (options.get('debug') && console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Using a hidden input with Select2 is no longer ' +
|
||||
'supported and may stop working in the future. It is recommended ' +
|
||||
@ -5170,7 +5172,7 @@ define('select2/compat/query',[
|
||||
|
||||
], function () {
|
||||
function Query (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `query` option has been deprecated in favor of a ' +
|
||||
'custom data adapter that overrides the `query` method. Support ' +
|
||||
|
18
dist/js/select2.amd.js
vendored
18
dist/js/select2.amd.js
vendored
@ -1171,7 +1171,7 @@ define('select2/selection/allowClear',[
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
if (self.placeholder == null) {
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
console.error(
|
||||
'Select2: The `allowClear` option should be used in combination ' +
|
||||
'with the `placeholder` option.'
|
||||
@ -2782,7 +2782,7 @@ define('select2/data/ajax',[
|
||||
var $request = options.transport(options, function (data) {
|
||||
var results = self.processResults(data, params);
|
||||
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
// Check to make sure that the response included a `results` key.
|
||||
if (!results || !results.results || !$.isArray(results.results)) {
|
||||
console.error(
|
||||
@ -3963,7 +3963,7 @@ define('select2/defaults',[
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (window.console && console.warn) {
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
@ -4044,6 +4044,7 @@ define('select2/defaults',[
|
||||
amdBase: 'select2/',
|
||||
amdLanguageBase: 'select2/i18n/',
|
||||
closeOnSelect: true,
|
||||
debug: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
@ -4139,7 +4140,7 @@ define('select2/options',[
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
||||
@ -4152,7 +4153,7 @@ define('select2/options',[
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
'`data-ajax--url` and support for the old attribute will be removed' +
|
||||
@ -4617,7 +4618,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("enable")` method has been deprecated and will' +
|
||||
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
||||
@ -4635,7 +4636,8 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.data = function () {
|
||||
if (arguments.length > 0 && window.console && console.warn) {
|
||||
if (this.options.get('debug') &&
|
||||
arguments.length > 0 && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
||||
'should consider setting the value instead using `$element.val()`.'
|
||||
@ -4652,7 +4654,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.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.'
|
||||
|
26
dist/js/select2.full.js
vendored
26
dist/js/select2.full.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:26:05 GMT
|
||||
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:39:48 GMT
|
||||
* https://select2.github.io
|
||||
*
|
||||
* Released under the MIT license
|
||||
@ -1617,7 +1617,7 @@ define('select2/selection/allowClear',[
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
if (self.placeholder == null) {
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
console.error(
|
||||
'Select2: The `allowClear` option should be used in combination ' +
|
||||
'with the `placeholder` option.'
|
||||
@ -3228,7 +3228,7 @@ define('select2/data/ajax',[
|
||||
var $request = options.transport(options, function (data) {
|
||||
var results = self.processResults(data, params);
|
||||
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
// Check to make sure that the response included a `results` key.
|
||||
if (!results || !results.results || !$.isArray(results.results)) {
|
||||
console.error(
|
||||
@ -4409,7 +4409,7 @@ define('select2/defaults',[
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (window.console && console.warn) {
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
@ -4490,6 +4490,7 @@ define('select2/defaults',[
|
||||
amdBase: 'select2/',
|
||||
amdLanguageBase: 'select2/i18n/',
|
||||
closeOnSelect: true,
|
||||
debug: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
@ -4585,7 +4586,7 @@ define('select2/options',[
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
||||
@ -4598,7 +4599,7 @@ define('select2/options',[
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
'`data-ajax--url` and support for the old attribute will be removed' +
|
||||
@ -5063,7 +5064,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("enable")` method has been deprecated and will' +
|
||||
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
||||
@ -5081,7 +5082,8 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.data = function () {
|
||||
if (arguments.length > 0 && window.console && console.warn) {
|
||||
if (this.options.get('debug') &&
|
||||
arguments.length > 0 && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
||||
'should consider setting the value instead using `$element.val()`.'
|
||||
@ -5098,7 +5100,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.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.'
|
||||
@ -5445,7 +5447,7 @@ define('select2/compat/initSelection',[
|
||||
'jquery'
|
||||
], function ($) {
|
||||
function InitSelection (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `initSelection` option has been deprecated in favor' +
|
||||
' of a custom data adapter that overrides the `current` method. ' +
|
||||
@ -5492,7 +5494,7 @@ define('select2/compat/inputData',[
|
||||
this._valueSeparator = options.get('valueSeparator') || ',';
|
||||
|
||||
if ($element.prop('type') === 'hidden') {
|
||||
if (console && console.warn) {
|
||||
if (options.get('debug') && console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Using a hidden input with Select2 is no longer ' +
|
||||
'supported and may stop working in the future. It is recommended ' +
|
||||
@ -5616,7 +5618,7 @@ define('select2/compat/query',[
|
||||
|
||||
], function () {
|
||||
function Query (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `query` option has been deprecated in favor of a ' +
|
||||
'custom data adapter that overrides the `query` method. Support ' +
|
||||
|
6
dist/js/select2.full.min.js
vendored
6
dist/js/select2.full.min.js
vendored
File diff suppressed because one or more lines are too long
20
dist/js/select2.js
vendored
20
dist/js/select2.js
vendored
@ -1,5 +1,5 @@
|
||||
/*!
|
||||
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:26:05 GMT
|
||||
* Select2 4.0.0-rc.1 - Thu, 12 Mar 2015 00:39:48 GMT
|
||||
* https://select2.github.io
|
||||
*
|
||||
* Released under the MIT license
|
||||
@ -1617,7 +1617,7 @@ define('select2/selection/allowClear',[
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
if (self.placeholder == null) {
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
console.error(
|
||||
'Select2: The `allowClear` option should be used in combination ' +
|
||||
'with the `placeholder` option.'
|
||||
@ -3228,7 +3228,7 @@ define('select2/data/ajax',[
|
||||
var $request = options.transport(options, function (data) {
|
||||
var results = self.processResults(data, params);
|
||||
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
// Check to make sure that the response included a `results` key.
|
||||
if (!results || !results.results || !$.isArray(results.results)) {
|
||||
console.error(
|
||||
@ -4409,7 +4409,7 @@ define('select2/defaults',[
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (window.console && console.warn) {
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
@ -4490,6 +4490,7 @@ define('select2/defaults',[
|
||||
amdBase: 'select2/',
|
||||
amdLanguageBase: 'select2/i18n/',
|
||||
closeOnSelect: true,
|
||||
debug: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
@ -4585,7 +4586,7 @@ define('select2/options',[
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
||||
@ -4598,7 +4599,7 @@ define('select2/options',[
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
'`data-ajax--url` and support for the old attribute will be removed' +
|
||||
@ -5063,7 +5064,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("enable")` method has been deprecated and will' +
|
||||
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
||||
@ -5081,7 +5082,8 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.data = function () {
|
||||
if (arguments.length > 0 && window.console && console.warn) {
|
||||
if (this.options.get('debug') &&
|
||||
arguments.length > 0 && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
||||
'should consider setting the value instead using `$element.val()`.'
|
||||
@ -5098,7 +5100,7 @@ define('select2/core',[
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.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.'
|
||||
|
4
dist/js/select2.min.js
vendored
4
dist/js/select2.min.js
vendored
File diff suppressed because one or more lines are too long
2
src/js/select2/compat/initSelection.js
vendored
2
src/js/select2/compat/initSelection.js
vendored
@ -2,7 +2,7 @@ define([
|
||||
'jquery'
|
||||
], function ($) {
|
||||
function InitSelection (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `initSelection` option has been deprecated in favor' +
|
||||
' of a custom data adapter that overrides the `current` method. ' +
|
||||
|
2
src/js/select2/compat/inputData.js
vendored
2
src/js/select2/compat/inputData.js
vendored
@ -6,7 +6,7 @@ define([
|
||||
this._valueSeparator = options.get('valueSeparator') || ',';
|
||||
|
||||
if ($element.prop('type') === 'hidden') {
|
||||
if (console && console.warn) {
|
||||
if (options.get('debug') && console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Using a hidden input with Select2 is no longer ' +
|
||||
'supported and may stop working in the future. It is recommended ' +
|
||||
|
2
src/js/select2/compat/query.js
vendored
2
src/js/select2/compat/query.js
vendored
@ -2,7 +2,7 @@ define([
|
||||
|
||||
], function () {
|
||||
function Query (decorated, $element, options) {
|
||||
if (window.console && console.warn) {
|
||||
if (options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `query` option has been deprecated in favor of a ' +
|
||||
'custom data adapter that overrides the `query` method. Support ' +
|
||||
|
7
src/js/select2/core.js
vendored
7
src/js/select2/core.js
vendored
@ -411,7 +411,7 @@ define([
|
||||
};
|
||||
|
||||
Select2.prototype.enable = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `select2("enable")` method has been deprecated and will' +
|
||||
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
||||
@ -429,7 +429,8 @@ define([
|
||||
};
|
||||
|
||||
Select2.prototype.data = function () {
|
||||
if (arguments.length > 0 && window.console && console.warn) {
|
||||
if (this.options.get('debug') &&
|
||||
arguments.length > 0 && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
||||
'should consider setting the value instead using `$element.val()`.'
|
||||
@ -446,7 +447,7 @@ define([
|
||||
};
|
||||
|
||||
Select2.prototype.val = function (args) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.get('debug') && window.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.'
|
||||
|
2
src/js/select2/data/ajax.js
vendored
2
src/js/select2/data/ajax.js
vendored
@ -64,7 +64,7 @@ define([
|
||||
var $request = options.transport(options, function (data) {
|
||||
var results = self.processResults(data, params);
|
||||
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
// Check to make sure that the response included a `results` key.
|
||||
if (!results || !results.results || !$.isArray(results.results)) {
|
||||
console.error(
|
||||
|
3
src/js/select2/defaults.js
vendored
3
src/js/select2/defaults.js
vendored
@ -237,7 +237,7 @@ define([
|
||||
// The translation could not be loaded at all. Sometimes this is
|
||||
// because of a configuration problem, other times this can be
|
||||
// because of how Select2 helps load all possible translation files.
|
||||
if (window.console && console.warn) {
|
||||
if (options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The language file for "' + name + '" could not be ' +
|
||||
'automatically loaded. A fallback will be used instead.'
|
||||
@ -318,6 +318,7 @@ define([
|
||||
amdBase: 'select2/',
|
||||
amdLanguageBase: 'select2/i18n/',
|
||||
closeOnSelect: true,
|
||||
debug: false,
|
||||
escapeMarkup: Utils.escapeMarkup,
|
||||
language: EnglishTranslation,
|
||||
matcher: matcher,
|
||||
|
4
src/js/select2/options.js
vendored
4
src/js/select2/options.js
vendored
@ -55,7 +55,7 @@ define([
|
||||
$e.prop('multiple', this.options.multiple);
|
||||
|
||||
if ($e.data('select2Tags')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
||||
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
||||
@ -68,7 +68,7 @@ define([
|
||||
}
|
||||
|
||||
if ($e.data('ajaxUrl')) {
|
||||
if (window.console && console.warn) {
|
||||
if (this.options.debug && window.console && console.warn) {
|
||||
console.warn(
|
||||
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
||||
'`data-ajax--url` and support for the old attribute will be removed' +
|
||||
|
2
src/js/select2/selection/allowClear.js
vendored
2
src/js/select2/selection/allowClear.js
vendored
@ -9,7 +9,7 @@ define([
|
||||
decorated.call(this, container, $container);
|
||||
|
||||
if (self.placeholder == null) {
|
||||
if (window.console && console.error) {
|
||||
if (self.options.get('debug') && window.console && console.error) {
|
||||
console.error(
|
||||
'Select2: The `allowClear` option should be used in combination ' +
|
||||
'with the `placeholder` option.'
|
||||
|
Loading…
x
Reference in New Issue
Block a user