|
@@ -10212,9 +10212,10 @@ define('select2/keys',[
|
|
});
|
|
});
|
|
|
|
|
|
define('select2/selection/base',[
|
|
define('select2/selection/base',[
|
|
|
|
+ 'jquery',
|
|
'../utils',
|
|
'../utils',
|
|
'../keys'
|
|
'../keys'
|
|
-], function (Utils, KEYS) {
|
|
|
|
|
|
+], function ($, Utils, KEYS) {
|
|
function BaseSelection ($element, options) {
|
|
function BaseSelection ($element, options) {
|
|
this.$element = $element;
|
|
this.$element = $element;
|
|
this.options = options;
|
|
this.options = options;
|
|
@@ -10225,7 +10226,17 @@ define('select2/selection/base',[
|
|
Utils.Extend(BaseSelection, Utils.Observable);
|
|
Utils.Extend(BaseSelection, Utils.Observable);
|
|
|
|
|
|
BaseSelection.prototype.render = function () {
|
|
BaseSelection.prototype.render = function () {
|
|
- throw new Error('The `render` method must be defined in child classes.');
|
|
|
|
|
|
+ var $selection = $(
|
|
|
|
+ '<span class="select2-selection" tabindex="0" role="combobox" ' +
|
|
|
|
+ 'aria-autocomplete="list" aria-haspopup="true" aria-expanded="false">' +
|
|
|
|
+ '</span>'
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ $selection.attr('title', this.$element.attr('title'));
|
|
|
|
+
|
|
|
|
+ this.$selection = $selection;
|
|
|
|
+
|
|
|
|
+ return $selection;
|
|
};
|
|
};
|
|
|
|
|
|
BaseSelection.prototype.bind = function (container, $container) {
|
|
BaseSelection.prototype.bind = function (container, $container) {
|
|
@@ -10270,6 +10281,14 @@ define('select2/selection/base',[
|
|
|
|
|
|
self._detachCloseHandler(container);
|
|
self._detachCloseHandler(container);
|
|
});
|
|
});
|
|
|
|
+
|
|
|
|
+ container.on('enable', function () {
|
|
|
|
+ self.$selection.attr('tabindex', '0');
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ container.on('disable', function () {
|
|
|
|
+ self.$selection.attr('tabindex', '-1');
|
|
|
|
+ });
|
|
};
|
|
};
|
|
|
|
|
|
BaseSelection.prototype._attachCloseHandler = function (container) {
|
|
BaseSelection.prototype._attachCloseHandler = function (container) {
|
|
@@ -10322,10 +10341,11 @@ define('select2/selection/base',[
|
|
});
|
|
});
|
|
|
|
|
|
define('select2/selection/single',[
|
|
define('select2/selection/single',[
|
|
|
|
+ 'jquery',
|
|
'./base',
|
|
'./base',
|
|
'../utils',
|
|
'../utils',
|
|
'../keys'
|
|
'../keys'
|
|
-], function (BaseSelection, Utils, KEYS) {
|
|
|
|
|
|
+], function ($, BaseSelection, Utils, KEYS) {
|
|
function SingleSelection () {
|
|
function SingleSelection () {
|
|
SingleSelection.__super__.constructor.apply(this, arguments);
|
|
SingleSelection.__super__.constructor.apply(this, arguments);
|
|
}
|
|
}
|
|
@@ -10333,20 +10353,16 @@ define('select2/selection/single',[
|
|
Utils.Extend(SingleSelection, BaseSelection);
|
|
Utils.Extend(SingleSelection, BaseSelection);
|
|
|
|
|
|
SingleSelection.prototype.render = function () {
|
|
SingleSelection.prototype.render = function () {
|
|
- var $selection = $(
|
|
|
|
- '<span class="select2-selection select2-selection--single" tabindex="0"' +
|
|
|
|
- ' role="combobox" aria-autocomplete="list" aria-haspopup="true"' +
|
|
|
|
- ' aria-expanded="false">' +
|
|
|
|
- '<span class="select2-selection__rendered"></span>' +
|
|
|
|
- '<span class="select2-selection__arrow" role="presentation">' +
|
|
|
|
- '<b role="presentation"></b>' +
|
|
|
|
- '</span>' +
|
|
|
|
- '</span>'
|
|
|
|
- );
|
|
|
|
|
|
+ var $selection = SingleSelection.__super__.render.call(this);
|
|
|
|
|
|
- $selection.attr('title', this.$element.attr('title'));
|
|
|
|
|
|
+ $selection.addClass('select2-selection--single');
|
|
|
|
|
|
- this.$selection = $selection;
|
|
|
|
|
|
+ $selection.html(
|
|
|
|
+ '<span class="select2-selection__rendered"></span>' +
|
|
|
|
+ '<span class="select2-selection__arrow" role="presentation">' +
|
|
|
|
+ '<b role="presentation"></b>' +
|
|
|
|
+ '</span>'
|
|
|
|
+ );
|
|
|
|
|
|
return $selection;
|
|
return $selection;
|
|
};
|
|
};
|
|
@@ -10380,14 +10396,6 @@ define('select2/selection/single',[
|
|
// User exits the container
|
|
// User exits the container
|
|
});
|
|
});
|
|
|
|
|
|
- container.on('enable', function () {
|
|
|
|
- self.$selection.attr('tabindex', '0');
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- container.on('disable', function () {
|
|
|
|
- self.$selection.attr('tabindex', '-1');
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
container.on('selection:update', function (params) {
|
|
container.on('selection:update', function (params) {
|
|
self.update(params.data);
|
|
self.update(params.data);
|
|
});
|
|
});
|
|
@@ -10424,9 +10432,10 @@ define('select2/selection/single',[
|
|
});
|
|
});
|
|
|
|
|
|
define('select2/selection/multiple',[
|
|
define('select2/selection/multiple',[
|
|
|
|
+ 'jquery',
|
|
'./base',
|
|
'./base',
|
|
'../utils'
|
|
'../utils'
|
|
-], function (BaseSelection, Utils) {
|
|
|
|
|
|
+], function ($, BaseSelection, Utils) {
|
|
function MultipleSelection ($element, options) {
|
|
function MultipleSelection ($element, options) {
|
|
MultipleSelection.__super__.constructor.apply(this, arguments);
|
|
MultipleSelection.__super__.constructor.apply(this, arguments);
|
|
}
|
|
}
|
|
@@ -10434,17 +10443,13 @@ define('select2/selection/multiple',[
|
|
Utils.Extend(MultipleSelection, BaseSelection);
|
|
Utils.Extend(MultipleSelection, BaseSelection);
|
|
|
|
|
|
MultipleSelection.prototype.render = function () {
|
|
MultipleSelection.prototype.render = function () {
|
|
- var $selection = $(
|
|
|
|
- '<span class="select2-selection select2-selection--multiple"' +
|
|
|
|
- ' tabindex="0" role="combobox" aria-autocomplete="list"' +
|
|
|
|
- ' aria-haspopup="true" aria-expanded="false">' +
|
|
|
|
- '<ul class="select2-selection__rendered"></ul>' +
|
|
|
|
- '</span>'
|
|
|
|
- );
|
|
|
|
|
|
+ var $selection = MultipleSelection.__super__.render.call(this);
|
|
|
|
|
|
- $selection.attr('title', this.$element.attr('title'));
|
|
|
|
|
|
+ $selection.addClass('select2-selection--multiple');
|
|
|
|
|
|
- this.$selection = $selection;
|
|
|
|
|
|
+ $selection.html(
|
|
|
|
+ '<ul class="select2-selection__rendered"></ul>'
|
|
|
|
+ );
|
|
|
|
|
|
return $selection;
|
|
return $selection;
|
|
};
|
|
};
|
|
@@ -10472,14 +10477,6 @@ define('select2/selection/multiple',[
|
|
data: data
|
|
data: data
|
|
});
|
|
});
|
|
});
|
|
});
|
|
-
|
|
|
|
- container.on('enable', function () {
|
|
|
|
- self.$selection.attr('tabindex', '0');
|
|
|
|
- });
|
|
|
|
-
|
|
|
|
- container.on('disable', function () {
|
|
|
|
- self.$selection.attr('tabindex', '-1');
|
|
|
|
- });
|
|
|
|
};
|
|
};
|
|
|
|
|
|
MultipleSelection.prototype.clear = function () {
|
|
MultipleSelection.prototype.clear = function () {
|