autocomplete: small fix to js
This commit is contained in:
parent
951c73d825
commit
7060debeca
1 changed files with 5 additions and 3 deletions
|
@ -120,6 +120,9 @@ function ContactAutocomplete(element,backend_url){
|
||||||
this.popup=null;
|
this.popup=null;
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
|
$(element).unbind('keydown');
|
||||||
|
$(element).unbind('keyup');
|
||||||
|
|
||||||
$(element).keydown(function(event){
|
$(element).keydown(function(event){
|
||||||
if (that.popup!==null) that.popup.onkey(event);
|
if (that.popup!==null) that.popup.onkey(event);
|
||||||
});
|
});
|
||||||
|
@ -145,15 +148,14 @@ function ContactAutocomplete(element,backend_url){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* jQuery plugin 'contact_autocomplete'
|
* jQuery plugin 'contact_autocomplete'
|
||||||
*/
|
*/
|
||||||
(function( $ ){
|
(function( $ ){
|
||||||
var map=new Array();
|
|
||||||
$.fn.contact_autocomplete = function(backend_url) {
|
$.fn.contact_autocomplete = function(backend_url) {
|
||||||
this.each(function(){
|
this.each(function(){
|
||||||
if (this in map) return;
|
new ContactAutocomplete(this, backend_url);
|
||||||
map[this] = new ContactAutocomplete(this, backend_url);
|
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
})( jQuery );
|
})( jQuery );
|
||||||
|
|
Loading…
Reference in a new issue