|
@@ -12843,6 +12843,34 @@ define('select2/dropdown/minimumResultsForSearch',[
|
|
return MinimumResultsForSearch;
|
|
return MinimumResultsForSearch;
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+define('select2/dropdown/selectOnClose',[
|
|
|
|
+
|
|
|
|
+], function () {
|
|
|
|
+ function SelectOnClose () { }
|
|
|
|
+
|
|
|
|
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
|
|
|
+ var self = this;
|
|
|
|
+
|
|
|
|
+ decorated.call(this, container, $container);
|
|
|
|
+
|
|
|
|
+ container.on('close', function () {
|
|
|
|
+ self._handleSelectOnClose();
|
|
|
|
+ });
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ SelectOnClose.prototype._handleSelectOnClose = function () {
|
|
|
|
+ var $highlightedResults = this.getHighlightedResults();
|
|
|
|
+
|
|
|
|
+ if ($highlightedResults.length < 1) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $highlightedResults.trigger('mouseup');
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ return SelectOnClose;
|
|
|
|
+});
|
|
|
|
+
|
|
define('select2/i18n/en',[],function () {
|
|
define('select2/i18n/en',[],function () {
|
|
// English
|
|
// English
|
|
return {
|
|
return {
|
|
@@ -12917,6 +12945,7 @@ define('select2/defaults',[
|
|
'./dropdown/infiniteScroll',
|
|
'./dropdown/infiniteScroll',
|
|
'./dropdown/attachBody',
|
|
'./dropdown/attachBody',
|
|
'./dropdown/minimumResultsForSearch',
|
|
'./dropdown/minimumResultsForSearch',
|
|
|
|
+ './dropdown/selectOnClose',
|
|
|
|
|
|
'./i18n/en'
|
|
'./i18n/en'
|
|
], function ($, ResultsList,
|
|
], function ($, ResultsList,
|
|
@@ -12930,7 +12959,7 @@ define('select2/defaults',[
|
|
MinimumInputLength, MaximumInputLength,
|
|
MinimumInputLength, MaximumInputLength,
|
|
|
|
|
|
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
|
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
|
- AttachBody, MinimumResultsForSearch,
|
|
|
|
|
|
+ AttachBody, MinimumResultsForSearch, SelectOnClose,
|
|
|
|
|
|
EnglishTranslation) {
|
|
EnglishTranslation) {
|
|
function Defaults () {
|
|
function Defaults () {
|
|
@@ -13009,6 +13038,13 @@ define('select2/defaults',[
|
|
);
|
|
);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (options.selectOnClose) {
|
|
|
|
+ options.dropdownAdapter = Utils.Decorate(
|
|
|
|
+ options.dropdownAdapter,
|
|
|
|
+ SelectOnClose
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+
|
|
options.dropdownAdapter = Utils.Decorate(
|
|
options.dropdownAdapter = Utils.Decorate(
|
|
options.dropdownAdapter,
|
|
options.dropdownAdapter,
|
|
AttachBody
|
|
AttachBody
|
|
@@ -13142,12 +13178,13 @@ define('select2/defaults',[
|
|
this.defaults = {
|
|
this.defaults = {
|
|
language: EnglishTranslation,
|
|
language: EnglishTranslation,
|
|
matcher: matcher,
|
|
matcher: matcher,
|
|
- sorter: function (data) {
|
|
|
|
- return data;
|
|
|
|
- },
|
|
|
|
minimumInputLength: 0,
|
|
minimumInputLength: 0,
|
|
maximumInputLength: 0,
|
|
maximumInputLength: 0,
|
|
minimumResultsForSearch: 0,
|
|
minimumResultsForSearch: 0,
|
|
|
|
+ selectOnClose: false,
|
|
|
|
+ sorter: function (data) {
|
|
|
|
+ return data;
|
|
|
|
+ },
|
|
templateResult: function (result) {
|
|
templateResult: function (result) {
|
|
return result.text;
|
|
return result.text;
|
|
},
|
|
},
|