mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 12:55:12 +00:00
add onSearchStartTransformParams callback support
This commit is contained in:
parent
75a8ae9038
commit
a2960e7e7e
@ -107,6 +107,7 @@
|
||||
type: 'GET',
|
||||
noCache: false,
|
||||
onSearchStart: noop,
|
||||
onSearchStartTransformParams: _identity,
|
||||
onSearchComplete: noop,
|
||||
onSearchError: noop,
|
||||
preserveInput: false,
|
||||
@ -125,6 +126,10 @@
|
||||
forceFixPosition: false
|
||||
};
|
||||
|
||||
function _identity(params) {
|
||||
return params;
|
||||
}
|
||||
|
||||
function _lookupFilter(suggestion, originalQuery, queryLowerCase) {
|
||||
return suggestion.value.toLowerCase().indexOf(queryLowerCase) !== -1;
|
||||
};
|
||||
@ -542,7 +547,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
params = options.ignoreParams ? null : options.params;
|
||||
params = options.ignoreParams ? null : (options.onSearchStartTransformParams.call(that.element, options.params));
|
||||
|
||||
if ($.isFunction(options.lookup)){
|
||||
options.lookup(q, function (data) {
|
||||
|
Loading…
Reference in New Issue
Block a user