Use typeahead signature and signal forgotten in changeset d4a27c6abb31

This commit is contained in:
Nicolas ?vrard 2015-09-04 17:14:22 +02:00
parent 2805d9242a
commit 59729a747a
3 changed files with 8 additions and 6 deletions

View file

@ -2888,6 +2888,7 @@
'minLength': 1,
'highlight': true
}, {
'limit': Sao.config.limit,
'name': 'suggestions',
'source': source,
'displayKey': 'rec_name',
@ -2918,7 +2919,7 @@
}
}
});
entry.on('typeahead:selected', match_selected);
entry.on('typeahead:select', match_selected);
};
Sao.common.update_completion = function(entry, record, field, model,
domain) {

View file

@ -340,6 +340,7 @@ var Sao = {};
this.search_entry.typeahead({
'highlight': false
}, {
'limit': Sao.config.limit,
'source': this.update.bind(this),
'displayKey': 'record_name',
'templates': {
@ -361,7 +362,7 @@ var Sao = {};
}
}
});
this.search_entry.on('typeahead:selected',
this.search_entry.on('typeahead:select',
this.match_selected.bind(this));
},
query: function(value) {
@ -371,7 +372,7 @@ var Sao = {};
return this.search_entry.typeahead('val', value);
}
},
update: function(query, process) {
update: function(query, sync, async) {
if (query != this.query()) {
return;
}
@ -393,7 +394,7 @@ var Sao = {};
'icon': s_results[i][5],
});
}
process(results);
async(results);
}.bind(this));
},
match_selected: function(event_, item, name) {

View file

@ -2611,7 +2611,7 @@
this.entry.data('search', this.read_access());
this.entry.data('create', this.create_access());
},
_update_completion: function(query, process) {
_update_completion: function(query, sync, async) {
var record = this.record();
if (!record) {
return;
@ -2628,7 +2628,7 @@
var prm = Sao.common.update_completion(this.entry, record, field,
model);
prm.done(process);
prm.done(async);
},
_completion_match_selected: function(event_, selected_item, name) {
if (selected_item.id == 'search') {