|
@@ -422,6 +422,7 @@ var requirejs, require, define;
|
|
|
|
|
|
define("almond", function(){});
|
|
|
|
|
|
+/* global jQuery:false, $:false */
|
|
|
define('jquery',[],function () {
|
|
|
var _$ = jQuery || $;
|
|
|
|
|
@@ -1203,21 +1204,7 @@ define('select2/keys',[
|
|
|
UP: 38,
|
|
|
RIGHT: 39,
|
|
|
DOWN: 40,
|
|
|
- DELETE: 46,
|
|
|
-
|
|
|
- isArrow: function (k) {
|
|
|
- k = k.which ? k.which : k;
|
|
|
-
|
|
|
- switch (k) {
|
|
|
- case KEY.LEFT:
|
|
|
- case KEY.RIGHT:
|
|
|
- case KEY.UP:
|
|
|
- case KEY.DOWN:
|
|
|
- return true;
|
|
|
- }
|
|
|
-
|
|
|
- return false;
|
|
|
- }
|
|
|
+ DELETE: 46
|
|
|
};
|
|
|
|
|
|
return KEYS;
|
|
@@ -1602,7 +1589,7 @@ define('select2/selection/allowClear',[
|
|
|
decorated.call(this, container, $container);
|
|
|
|
|
|
if (self.placeholder == null) {
|
|
|
- if (console && console.error) {
|
|
|
+ if (window.console && console.error) {
|
|
|
console.error(
|
|
|
'Select2: The `allowClear` option should be used in combination ' +
|
|
|
'with the `placeholder` option.'
|
|
@@ -2823,7 +2810,7 @@ define('select2/data/select',[
|
|
|
data.push.apply(data, currentData);
|
|
|
|
|
|
for (var d = 0; d < data.length; d++) {
|
|
|
- id = data[d].id;
|
|
|
+ var id = data[d].id;
|
|
|
|
|
|
if (val.indexOf(id) === -1) {
|
|
|
val.push(id);
|
|
@@ -2861,7 +2848,7 @@ define('select2/data/select',[
|
|
|
var val = [];
|
|
|
|
|
|
for (var d = 0; d < currentData.length; d++) {
|
|
|
- id = currentData[d].id;
|
|
|
+ var id = currentData[d].id;
|
|
|
|
|
|
if (id !== data.id && val.indexOf(id) === -1) {
|
|
|
val.push(id);
|
|
@@ -3197,7 +3184,7 @@ define('select2/data/ajax',[
|
|
|
var $request = options.transport(options, function (data) {
|
|
|
var results = self.processResults(data, params);
|
|
|
|
|
|
- if (console && console.error) {
|
|
|
+ if (window.console && console.error) {
|
|
|
// Check to make sure that the response included a `results` key.
|
|
|
if (!results || !results.results || !$.isArray(results.results)) {
|
|
|
console.error(
|
|
@@ -3866,7 +3853,7 @@ define('select2/dropdown/attachBody',[
|
|
|
var resizeEvent = 'resize.select2.' + container.id;
|
|
|
var orientationEvent = 'orientationchange.select2.' + container.id;
|
|
|
|
|
|
- $watchers = this.$container.parents().filter(Utils.hasScroll);
|
|
|
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
|
|
$watchers.each(function () {
|
|
|
$(this).data('select2-scroll-position', {
|
|
|
x: $(this).scrollLeft(),
|
|
@@ -3891,7 +3878,7 @@ define('select2/dropdown/attachBody',[
|
|
|
var resizeEvent = 'resize.select2.' + container.id;
|
|
|
var orientationEvent = 'orientationchange.select2.' + container.id;
|
|
|
|
|
|
- $watchers = this.$container.parents().filter(Utils.hasScroll);
|
|
|
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
|
|
$watchers.off(scrollEvent);
|
|
|
|
|
|
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
|
@@ -3983,7 +3970,7 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|
|
|
|
|
], function () {
|
|
|
function countResults (data) {
|
|
|
- count = 0;
|
|
|
+ var count = 0;
|
|
|
|
|
|
for (var d = 0; d < data.length; d++) {
|
|
|
var item = data[d];
|
|
@@ -4356,7 +4343,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 (console && console.warn) {
|
|
|
+ if (window.console && console.warn) {
|
|
|
console.warn(
|
|
|
'Select2: The lanugage file for "' + name + '" could not be ' +
|
|
|
'automatically loaded. A fallback will be used instead.'
|
|
@@ -4523,7 +4510,7 @@ define('select2/options',[
|
|
|
$e.prop('multiple', this.options.multiple);
|
|
|
|
|
|
if ($e.data('select2-tags')) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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 ' +
|
|
@@ -4536,7 +4523,7 @@ define('select2/options',[
|
|
|
}
|
|
|
|
|
|
if ($e.data('ajax-url')) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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' +
|
|
@@ -4722,8 +4709,8 @@ define('select2/core',[
|
|
|
|
|
|
var attrs = style.split(';');
|
|
|
|
|
|
- for (i = 0, l = attrs.length; i < l; i = i + 1) {
|
|
|
- attr = attrs[i].replace(/\s/g, '');
|
|
|
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
|
|
|
+ var attr = attrs[i].replace(/\s/g, '');
|
|
|
var matches = attr.match(WIDTH);
|
|
|
|
|
|
if (matches !== null && matches.length >= 1) {
|
|
@@ -4970,7 +4957,7 @@ define('select2/core',[
|
|
|
};
|
|
|
|
|
|
Select2.prototype.enable = function (args) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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")' +
|
|
@@ -4988,7 +4975,7 @@ define('select2/core',[
|
|
|
};
|
|
|
|
|
|
Select2.prototype.data = function () {
|
|
|
- if (arguments.length > 0 && console && console.warn) {
|
|
|
+ if (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()`.'
|
|
@@ -5005,7 +4992,7 @@ define('select2/core',[
|
|
|
};
|
|
|
|
|
|
Select2.prototype.val = function (args) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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.'
|
|
@@ -5349,7 +5336,7 @@ define('select2/compat/initSelection',[
|
|
|
'jquery'
|
|
|
], function ($) {
|
|
|
function InitSelection (decorated, $element, options) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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. ' +
|
|
@@ -5392,7 +5379,7 @@ define('select2/compat/query',[
|
|
|
|
|
|
], function () {
|
|
|
function Query (decorated, $element, options) {
|
|
|
- if (console && console.warn) {
|
|
|
+ if (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 ' +
|