From c8da73626e2340f7f4215b36c7e2b9ff11bb1948 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Mon, 2 Jul 2012 14:54:58 +0200 Subject: [PATCH] [IMP] Hide seatchview on outside click event bzr revid: fme@openerp.com-20120702125458-d44dtn8lgr0x4ads --- addons/web/static/src/js/search.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 2e332ed8b28..c8b6f797dba 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -352,6 +352,11 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea e.stopImmediatePropagation(); self.$element.toggleClass('oe_searchview_open_drawer'); }); + instance.web.bus.on('click', this, function(ev) { + if ($(ev.target).parents('.oe_searchview').length === 0) { + self.$element.removeClass('oe_searchview_open_drawer'); + } + }); // Focus last input if the view itself is clicked (empty section of // facets element) this.$element.on('click', function (e) {