From 0d51f8992c4fad5cd46a0879b22dc2a697eb0769 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 9 May 2012 17:12:17 +0200 Subject: [PATCH] [IMP] Insert completed facet in stead of the index used for the completion, instead of always adding them to the end (if applicable) bzr revid: xmo@openerp.com-20120509151217-4juo2hm8xxj21uj9 --- addons/web/static/src/js/search.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 198740f4a97..7c35a79ef84 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -500,7 +500,10 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea select_completion: function (e, ui) { e.preventDefault(); - this.query.add(ui.item.facet); + var input_index = _(this.input_subviews).indexOf( + this.subviewForRoot( + this.$element.find('div.oe_searchview_input:focus')[0])); + this.query.add(ui.item.facet, {at: input_index / 2}); }, renderFacets: function () { var self = this;