[FIX] add hook to SearchInput's autocomplete#close to close the global autocompletion when getting out of an input

bzr revid: xmo@openerp.com-20120322103137-7og8ww7yjdr60tla
This commit is contained in:
Xavier Morel 2012-03-22 11:31:37 +01:00
parent 76baf024fc
commit 0e93da53b8
1 changed files with 5 additions and 2 deletions

View File

@ -226,14 +226,17 @@ openerp.web.SearchView = openerp.web.Widget.extend(/** @lends openerp.web.Search
make_visualsearch_input: function (options) {
var self = this, input = new VS.ui.SearchInput(options);
input.setupAutocomplete = function () {
this.box.autocomplete({
_.extend(this.box.autocomplete({
minLength: 1,
delay: 0,
search: function () {
self.$element.autocomplete('search', input.box.val());
return false;
}
}).data('autocomplete')._move = function () {};
}).data('autocomplete'), {
_move: function () {},
close: function () { self.$element.autocomplete('close'); }
});
};
return input;
},