From 4abfb09d323e3549a753573f8f6a10be7797b03f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 3 Apr 2012 11:56:15 +0200 Subject: [PATCH] [IMP] apply current advanced search when pressing [Return] while altering the search Wrap a form around the search and hook search commit on form submit, make the 'apply' button into a submit button bzr revid: xmo@openerp.com-20120403095615-r8x5ropf8odr7oxw --- addons/web/static/src/js/search.js | 3 ++- addons/web/static/src/xml/base.xml | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 0d56c3ddee0..2485c87e687 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -1280,7 +1280,8 @@ openerp.web.search.Advanced = openerp.web.search.Input.extend({ self.$element.toggleClass('oe_opened'); }).on('click', 'button.oe_add_condition', function () { self.append_proposition(); - }).on('click', 'button.oe_apply', function () { + }).on('submit', 'form', function (e) { + e.preventDefault(); self.commit_search(); }); return $.when( diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index a538ed01196..30bf8e6ec93 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1397,13 +1397,13 @@

Advanced Search...

-
+
- - -
+ + +