Skip to content

Commit 698d217

Browse files
committed
Merge branch 'bugfixes'
2 parents 7573611 + 5f55d2d commit 698d217

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Introduction to the original plugin, and an explanation of original plugin optio
1313
This modification shouldn’t break any of the options discussed at the these documentation files.
1414

1515
##Abridged Changelog##
16+
####1.2.1 --AGA####
17+
* Added option to forgo input focus on item select. `inputFocus` is set to true by default, but setting it to false in the options will cancel this behavior.
18+
1619
####1.2 --AGA####
1720
* Use recursive merging when extending setOptions. (Request/recommendation by smarques.)
1821

changelog.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
1.2.1 --AGA
2+
---
3+
* Added option to forgo input focus on item select. `inputFocus` is set to true by default, but setting it to false in the options will cancel this behavior.
4+
15
1.2 --AGA
26
---
37
* Use recursive merging when extending setOptions. (Request/recommendation by smarques.)

jquery.autocomplete.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
* jQuery Autocomplete plugin 1.2
2+
* jQuery Autocomplete plugin 1.2.1
33
*
44
* Copyright (c) 2009 Jörn Zaefferer
55
*
66
* Dual licensed under the MIT and GPL licenses:
77
* http://www.opensource.org/licenses/mit-license.php
88
* http://www.gnu.org/licenses/gpl.html
99
*
10-
* With a small modifications by Alfonso Gómez-Arzola.
10+
* With small modifications by Alfonso Gómez-Arzola.
1111
* See changelog for details.
1212
*
1313
*/
@@ -160,7 +160,7 @@ $.Autocompleter = function(input, options) {
160160
// results if the field no longer has focus
161161
hasFocus++;
162162
}).blur(function() {
163-
hasFocus = 0;
163+
hasFocus = 0;
164164
if (!config.mouseDownOnSelect) {
165165
hideResults();
166166
}
@@ -427,6 +427,7 @@ $.Autocompleter.defaults = {
427427
width: 0,
428428
multiple: false,
429429
multipleSeparator: " ",
430+
inputFocus: true,
430431
highlight: function(value, term) {
431432
return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
432433
},
@@ -604,8 +605,8 @@ $.Autocompleter.Select = function (options, input, select, config) {
604605
}).click(function(event) {
605606
$(target(event)).addClass(CLASSES.ACTIVE);
606607
select();
607-
// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
608-
input.focus();
608+
if( options.inputFocus )
609+
input.focus();
609610
return false;
610611
}).mousedown(function() {
611612
config.mouseDownOnSelect = true;

jquery.autocomplete.min.js

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jquery.autocomplete.pack.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)