summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-04-25 18:05:09 +0200
committerNicolas Lempereur <nle@odoo.com>2015-04-24 11:32:58 +0200
commita1bfa84f65a72fb1ff50e00e2cc4792e9d9bf4d1 (patch)
tree3bd0dece643ea75f53c3ebbc9286675b2446230b /addons
parente66efbd9f66424d1ddf4ef523d37404c69364de1 (diff)
[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
Diffstat (limited to 'addons')
-rw-r--r--addons/web/static/src/js/search.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index 701f81d335a..8b82ed0cbd2 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -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 () {