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",
|
"name": "devbridge-autocomplete",
|
||||||
"version": "1.2.13",
|
"version": "1.2.14",
|
||||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Tomas Kirda"
|
"Tomas Kirda"
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"ajax",
|
"ajax",
|
||||||
"autocomplete"
|
"autocomplete"
|
||||||
],
|
],
|
||||||
"version": "1.2.13",
|
"version": "1.2.14",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tomas Kirda",
|
"name": "Tomas Kirda",
|
||||||
"url": "https://github.com/tkirda"
|
"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
|
* (c) 2014 Tomas Kirda
|
||||||
*
|
*
|
||||||
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
||||||
@ -613,6 +613,7 @@
|
|||||||
|
|
||||||
var that = this,
|
var that = this,
|
||||||
options = that.options,
|
options = that.options,
|
||||||
|
groupBy = options.groupBy,
|
||||||
formatResult = options.formatResult,
|
formatResult = options.formatResult,
|
||||||
value = that.getQuery(that.currentValue),
|
value = that.getQuery(that.currentValue),
|
||||||
className = that.classes.suggestion,
|
className = that.classes.suggestion,
|
||||||
@ -621,6 +622,18 @@
|
|||||||
noSuggestionsContainer = $(that.noSuggestionsContainer),
|
noSuggestionsContainer = $(that.noSuggestionsContainer),
|
||||||
beforeRender = options.beforeRender,
|
beforeRender = options.beforeRender,
|
||||||
html = '',
|
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;
|
index;
|
||||||
|
|
||||||
if (options.triggerSelectOnValidInput) {
|
if (options.triggerSelectOnValidInput) {
|
||||||
@ -633,6 +646,10 @@
|
|||||||
|
|
||||||
// Build suggestions inner HTML:
|
// Build suggestions inner HTML:
|
||||||
$.each(that.suggestions, function (i, suggestion) {
|
$.each(that.suggestions, function (i, suggestion) {
|
||||||
|
if (groupBy){
|
||||||
|
html += formatGroup(suggestion, value, i);
|
||||||
|
}
|
||||||
|
|
||||||
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
|
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "devbridge-autocomplete",
|
"name": "devbridge-autocomplete",
|
||||||
"version": "1.2.13",
|
"version": "1.2.14",
|
||||||
"description": "Autocomplete provides suggestions while you type into the text field.",
|
"description": "Autocomplete provides suggestions while you type into the text field.",
|
||||||
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
"homepage": "https://github.com/devbridge/jQuery-Autocomplete",
|
||||||
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
"author": "Tomas Kirda (https://twitter.com/tkirda)",
|
||||||
|
Loading…
Reference in New Issue
Block a user