summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2012-04-03 11:56:15 +0200
committerXavier Morel <xmo@openerp.com>2012-04-03 11:56:15 +0200
commit4abfb09d323e3549a753573f8f6a10be7797b03f (patch)
tree77a07c85f7e24da29c71db8bec9b550a395b1f8e /addons/web/static/src
parentd4aa6b6fea85983bef9cf0005f073bd9acba7ea3 (diff)
[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
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/search.js3
-rw-r--r--addons/web/static/src/xml/base.xml8
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 @@
</t>
<div t-name="SearchView.advanced" class="oe_searchview_advanced">
<h4>Advanced Search...</h4>
- <div>
+ <form>
<ul>
</ul>
- <button class="oe_add_condition">Add a condition</button>
- <button class="oe_apply">Apply</button>
- </div>
+ <button class="oe_add_condition" type="button">Add a condition</button>
+ <button class="oe_apply" type="submit">Apply</button>
+ </form>
</div>
<t t-name="SearchView.extended_search.proposition">
<li>