|
@@ -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 ' +
|