From 59729a747accbfc3754870cf49a7f22ad1193d0d Mon Sep 17 00:00:00 2001 From: Nicolas ?vrard Date: Fri, 4 Sep 2015 17:14:22 +0200 Subject: [PATCH] Use typeahead signature and signal forgotten in changeset d4a27c6abb31 --- src/common.js | 3 ++- src/sao.js | 7 ++++--- src/view.js | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/common.js b/src/common.js index 2f03093..e2691bd 100644 --- a/src/common.js +++ b/src/common.js @@ -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) { diff --git a/src/sao.js b/src/sao.js index 58dffbd..73d3743 100644 --- a/src/sao.js +++ b/src/sao.js @@ -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) { diff --git a/src/view.js b/src/view.js index 8c0f663..109ed16 100644 --- a/src/view.js +++ b/src/view.js @@ -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') {