Closing previously occured on search request (so that a user wouldn't be able
to select "old" data on new search request), but ``search`` is only triggered
after the search delay. Worked when delay was 0, with it being moved to 250 a
user can get results matching the previous search instead of the current one.
Trigger a closing of the current results list on any ``input`` event, which is
when text is entered in any of the searchview's ``InputView``.
bzr revid: xmo@openerp.com-
20140210123416-cfc0x24bfkiv4lse
* Sets up search view's view-wide auto-completion widget
*/
setup_global_completion: function () {
- var self = this;
-
var autocomplete = this.$el.autocomplete({
source: this.proxy('complete_global_search'),
select: this.proxy('select_completion'),
- search: function () { self.$el.autocomplete('close'); },
focus: function (e) { e.preventDefault(); },
html: true,
autoFocus: true,
delay: 250,
}).data('autocomplete');
+ this.$el.on('input', function () {
+ this.$el.autocomplete('close');
+ }.bind(this));
+
// MonkeyPatch autocomplete instance
_.extend(autocomplete, {
_renderItem: function (ul, item) {