mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
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:
parent
4512f72dc0
commit
a5731a5452
@ -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++) {
|
||||
|
Loading…
Reference in New Issue
Block a user