mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03:30
Merge pull request #565 from ansible/no_placeholder_select2_typeahead
munge placeholder from select2 typeahead search bar
This commit is contained in:
@@ -636,6 +636,22 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
|
|||||||
|
|
||||||
if (!multiple) {
|
if (!multiple) {
|
||||||
config.minimumResultsForSearch = 1;
|
config.minimumResultsForSearch = 1;
|
||||||
|
config.matcher = function(params, data) {
|
||||||
|
// If there are no search terms, return all of the data
|
||||||
|
if ($.trim(params.term) === '' &&
|
||||||
|
data.text.indexOf("Choose an") === -1) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do not display the item if there is no 'text' property
|
||||||
|
if (typeof data.text === 'undefined' ||
|
||||||
|
data.text.indexOf("Choose an") > -1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Return `null` if the term should not be displayed
|
||||||
|
return null;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user