autocomplete, continued
This commit is contained in:
parent
8f18c726b6
commit
07ec8f30f7
2 changed files with 7 additions and 5 deletions
|
|
@ -331,7 +331,6 @@
|
|||
autocomplete: function(value, callback) {
|
||||
value = value.toLowerCase();
|
||||
var items = [],
|
||||
regexp = new RegExp("(" + value + ")", "ig"),
|
||||
states = [
|
||||
"Alabama", "Alaska", "Arizona", "Arkansas", "California",
|
||||
"Colorado", "Connecticut", "Delaware", "District of Columbia", "Florida",
|
||||
|
|
@ -350,7 +349,10 @@
|
|||
} else {
|
||||
$.each(states, function(i, state) {
|
||||
if (state.toLowerCase().indexOf(value) > -1) {
|
||||
items.push(state.replace(regexp, "<span class=\"OxHighlight\">$1</span>"));
|
||||
items.push(state.replace(
|
||||
new RegExp("(" + value + ")", "ig"),
|
||||
"<span class=\"OxHighlight\">$1</span>")
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue