mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 12:55:12 +00:00
Rev for 1.2.25 release
This commit is contained in:
parent
3f53453499
commit
95a329d80d
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "devbridge-autocomplete",
|
"name": "devbridge-autocomplete",
|
||||||
"version": "1.2.24",
|
"version": "1.2.25",
|
||||||
"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.24",
|
"version": "1.2.25",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Tomas Kirda",
|
"name": "Tomas Kirda",
|
||||||
"url": "https://github.com/tkirda"
|
"url": "https://github.com/tkirda"
|
||||||
|
16
dist/jquery.autocomplete.js
vendored
16
dist/jquery.autocomplete.js
vendored
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Ajax Autocomplete for jQuery, version 1.2.24
|
* Ajax Autocomplete for jQuery, version 1.2.25
|
||||||
* (c) 2015 Tomas Kirda
|
* (c) 2015 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.
|
||||||
@ -127,6 +127,11 @@
|
|||||||
$.Autocomplete = Autocomplete;
|
$.Autocomplete = Autocomplete;
|
||||||
|
|
||||||
Autocomplete.formatResult = function (suggestion, currentValue) {
|
Autocomplete.formatResult = function (suggestion, currentValue) {
|
||||||
|
// Do not replace anything if there current value is empty
|
||||||
|
if (!currentValue) {
|
||||||
|
return suggestion.value;
|
||||||
|
}
|
||||||
|
|
||||||
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
|
var pattern = '(' + utils.escapeRegExChars(currentValue) + ')';
|
||||||
|
|
||||||
return suggestion.value
|
return suggestion.value
|
||||||
@ -188,6 +193,7 @@
|
|||||||
// Listen for click event on suggestions list:
|
// Listen for click event on suggestions list:
|
||||||
container.on('click.autocomplete', suggestionSelector, function () {
|
container.on('click.autocomplete', suggestionSelector, function () {
|
||||||
that.select($(this).data('index'));
|
that.select($(this).data('index'));
|
||||||
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
that.fixPositionCapture = function () {
|
that.fixPositionCapture = function () {
|
||||||
@ -208,8 +214,10 @@
|
|||||||
|
|
||||||
onFocus: function () {
|
onFocus: function () {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
that.fixPosition();
|
that.fixPosition();
|
||||||
if (that.options.minChars === 0 && that.el.val().length === 0) {
|
|
||||||
|
if (that.el.val().length >= that.options.minChars) {
|
||||||
that.onValueChange();
|
that.onValueChange();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -672,7 +680,7 @@
|
|||||||
html += formatGroup(suggestion, value, i);
|
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, i) + '</div>';
|
||||||
});
|
});
|
||||||
|
|
||||||
this.adjustContainerWidth();
|
this.adjustContainerWidth();
|
||||||
@ -681,7 +689,7 @@
|
|||||||
container.html(html);
|
container.html(html);
|
||||||
|
|
||||||
if ($.isFunction(beforeRender)) {
|
if ($.isFunction(beforeRender)) {
|
||||||
beforeRender.call(that.element, container, that.sugestions);
|
beforeRender.call(that.element, container, that.suggestions);
|
||||||
}
|
}
|
||||||
|
|
||||||
that.fixPosition();
|
that.fixPosition();
|
||||||
|
4
dist/jquery.autocomplete.min.js
vendored
4
dist/jquery.autocomplete.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "devbridge-autocomplete",
|
"name": "devbridge-autocomplete",
|
||||||
"version": "1.2.24",
|
"version": "1.2.25",
|
||||||
"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