mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-09 23:01:00 +00:00
Rev for 1.2.14 release
This commit is contained in:
parent
fb920860c5
commit
d71867a090
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "devbridge-autocomplete",
|
||||
"version": "1.2.13",
|
||||
"version": "1.2.14",
|
||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||
"authors": [
|
||||
"Tomas Kirda"
|
||||
|
@ -6,7 +6,7 @@
|
||||
"ajax",
|
||||
"autocomplete"
|
||||
],
|
||||
"version": "1.2.13",
|
||||
"version": "1.2.14",
|
||||
"author": {
|
||||
"name": "Tomas Kirda",
|
||||
"url": "https://github.com/tkirda"
|
||||
|
19
dist/jquery.autocomplete.js
vendored
19
dist/jquery.autocomplete.js
vendored
@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Ajax Autocomplete for jQuery, version 1.2.13
|
||||
* Ajax Autocomplete for jQuery, version 1.2.14
|
||||
* (c) 2014 Tomas Kirda
|
||||
*
|
||||
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
||||
@ -613,6 +613,7 @@
|
||||
|
||||
var that = this,
|
||||
options = that.options,
|
||||
groupBy = options.groupBy,
|
||||
formatResult = options.formatResult,
|
||||
value = that.getQuery(that.currentValue),
|
||||
className = that.classes.suggestion,
|
||||
@ -621,6 +622,18 @@
|
||||
noSuggestionsContainer = $(that.noSuggestionsContainer),
|
||||
beforeRender = options.beforeRender,
|
||||
html = '',
|
||||
category,
|
||||
formatGroup = function (suggestion, index) {
|
||||
var currentCategory = suggestion.data[groupBy];
|
||||
|
||||
if (category === currentCategory){
|
||||
return '';
|
||||
}
|
||||
|
||||
category = currentCategory;
|
||||
|
||||
return '<div class="autocomplete-group"><strong>' + category + '</strong></div>';
|
||||
},
|
||||
index;
|
||||
|
||||
if (options.triggerSelectOnValidInput) {
|
||||
@ -633,6 +646,10 @@
|
||||
|
||||
// Build suggestions inner HTML:
|
||||
$.each(that.suggestions, function (i, suggestion) {
|
||||
if (groupBy){
|
||||
html += formatGroup(suggestion, value, i);
|
||||
}
|
||||
|
||||
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
|
||||
});
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "devbridge-autocomplete",
|
||||
"version": "1.2.13",
|
||||
"version": "1.2.14",
|
||||
"description": "Autocomplete provides suggestions while you type into the text field.",
|
||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
||||
|
Loading…
Reference in New Issue
Block a user