mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -03:30
Removing search field on select2 fields used in inventory sources tab.
This also fixes the behavior when the user hits escape while the select2 drop down menu is visible.
This commit is contained in:
@@ -695,25 +695,27 @@ angular.module('Utilities', ['RestServices', 'Utilities', 'sanitizeFilter'])
|
||||
options = params.opts;
|
||||
|
||||
$.fn.select2.amd.require([
|
||||
"select2/utils",
|
||||
"select2/dropdown",
|
||||
"select2/dropdown/attachContainer",
|
||||
"select2/dropdown/search",
|
||||
], function (Utils, DropdownAdapter, AttachContainer, DropdownSearch) {
|
||||
'select2/utils',
|
||||
'select2/dropdown',
|
||||
'select2/dropdown/search',
|
||||
'select2/dropdown/attachContainer',
|
||||
'select2/dropdown/closeOnSelect',
|
||||
'select2/dropdown/minimumResultsForSearch'
|
||||
], function (Utils, Dropdown, Search, AttachContainer, CloseOnSelect, MinimumResultsForSearch) {
|
||||
|
||||
var CustomAdapter = Utils.Decorate(
|
||||
Utils.Decorate(
|
||||
DropdownAdapter,
|
||||
DropdownSearch
|
||||
),
|
||||
AttachContainer
|
||||
);
|
||||
var CustomAdapter =
|
||||
_.reduce([Search, AttachContainer, CloseOnSelect, MinimumResultsForSearch],
|
||||
function(Adapter, Decorator) {
|
||||
return Utils.Decorate(Adapter, Decorator);
|
||||
}, Dropdown);
|
||||
|
||||
$(element).select2({
|
||||
dropdownAdapter: CustomAdapter,
|
||||
multiple: 'true',
|
||||
theme: "bootstrap",
|
||||
width: '100%'
|
||||
width: '100%',
|
||||
minimumResultsForSearch: Infinity,
|
||||
dropdownAdapter: CustomAdapter
|
||||
});
|
||||
if(options){
|
||||
for (var d = 0; d < $(element + " option").length; d++) {
|
||||
|
||||
Reference in New Issue
Block a user