[FIX] web: get right result for arrow suggestions

In the search input, the result of filtered search with an arrow was
placed under the currently selected arrow.

Hence if we get to another arrow filter before the result is received,
the result is added under the wrong arrow.

This fix adds the result under the right arrow.

closes #6442
opw-632519
This commit is contained in:
Nicolas Lempereur 2015-04-25 18:05:09 +02:00
parent e66efbd9f6
commit a1bfa84f65
1 changed files with 5 additions and 4 deletions

View File

@ -2502,14 +2502,15 @@ instance.web.search.AutoComplete = instance.web.Widget.extend({
},
expand: function () {
var self = this;
this.current_result.expand(this.get_search_string()).then(function (results) {
var current_result = this.current_result;
current_result.expand(this.get_search_string()).then(function (results) {
(results || [{label: '(no result)'}]).reverse().forEach(function (result) {
result.indent = true;
var $li = self.make_list_item(result);
self.current_result.$el.after($li);
current_result.$el.after($li);
});
self.current_result.expanded = true;
self.current_result.$el.find('span.oe-expand').html('▼');
current_result.expanded = true;
current_result.$el.find('span.oe-expand').html('▼');
});
},
fold: function () {