From 6b719b708f18a18543368b18031643f98b00910b Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 24 Jul 2012 14:46:07 +0200 Subject: [PATCH] [IMP] trigger a new search when clicking on the searchview's spyglass Required reifying the purely decorative spyglass (created via :before) into an actual button and moving that button to the right place (after removing all decorations set by default on buttons e.g. shadows &al). apr request. bzr revid: xmo@openerp.com-20120724124607-bc1nsywtth7cn11i --- addons/web/static/src/css/base.css | 55 +++++++++++++---------------- addons/web/static/src/css/base.sass | 23 ++++++------ addons/web/static/src/js/search.js | 6 ++++ addons/web/static/src/xml/base.xml | 2 ++ 4 files changed, 45 insertions(+), 41 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 2e26de30d5f..2be11ff020d 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1,4 +1,4 @@ -@charset "UTF-8"; +@charset "utf-8"; @font-face { font-family: "mnmliconsRegular"; src: url("/web/static/src/font/mnmliconsv21-webfont.eot") format("eot"); @@ -1408,20 +1408,31 @@ filter: alpha(opacity=50); opacity: 0.5; } +.openerp .oe_searchview .oe_searchview_search { + font-size: 1px; + letter-spacing: -1px; + color: transparent; + -moz-box-shadow: none; + -webkit-box-shadow: none; + box-shadow: none; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; + position: absolute; + left: 3px; + top: 1px; + padding: 0; + border: none; + background: transparent; +} +.openerp .oe_searchview .oe_searchview_search:before { + font: 21px "mnmliconsRegular"; + content: "r"; + color: #a3a3a3; +} .openerp .oe_searchview .oe_searchview_facets { min-height: 22px; -} -.openerp .oe_searchview .oe_searchview_facets:before { - color: #cccccc; - font-family: "mnmliconsRegular"; - content: "r"; - font-size: 130%; - display: inline; - position: relative; - left: 6px; - top: 2px; - color: #a3a3a3; - padding-right: 4px; + margin-left: 15px; } .openerp .oe_searchview .oe_searchview_facets * { vertical-align: top; @@ -2180,7 +2191,7 @@ height: auto; line-height: 16px; } -.openerp .oe_form_field_one2many .oe_list_buttons.oe_editing .oe_list_save { +.openerp .oe_form_field_one2many .oe_list_buttons.oe_editing .oe_list_save, .openerp .oe_form_field_many2many .oe_list_buttons.oe_editing .oe_list_save { visibility: hidden; } .openerp .oe_form .oe_form_field_many2many > .oe_list .oe_list_pager_single_page { @@ -2266,9 +2277,6 @@ padding: 3px 6px; white-space: pre-line; } -.openerp .oe_list_content > tbody > tr > td.oe_list_field_cell progress { - width: 100%; -} .openerp .oe_list_content > tbody > tr > td > button, .openerp .oe_list_content > tbody > tr > th > button { border: none; background: transparent; @@ -2441,19 +2449,6 @@ .kitten-mode-activated > * { opacity: 0.7; } -.kitten-mode-activated .oe_footer a { - background-image: url(http://www.risacher.com/la-rache/zfiles/la-rache.png); - font-size: 1px; - letter-spacing: -1px; - color: transparent; - display: inline-block; - height: 15px; - width: 80px; - vertical-align: top; -} -.kitten-mode-activated .oe_footer a span { - display: none; -} div.ui-widget-overlay { background: black; diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index c4314923867..aef356d3ab6 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1101,19 +1101,20 @@ $sheet-max-width: 860px border-right: 5px solid transparent @include opacity() + .oe_searchview_search + @include text-to-icon("r", #a3a3a3) + @include box-shadow(none) + @include radius(0) + position: absolute + left: 3px + top: 1px + padding: 0 + border: none + background: transparent + .oe_searchview_facets min-height: 22px - &:before - color: #ccc - font-family: "mnmliconsRegular" - content: "r" - font-size: 130% - display: inline - position: relative - left: 6px - top: 2px - color: #a3a3a3 - padding-right: 4px + margin-left: 15px * vertical-align: top display: inline-block diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js index 8de2562a798..8ffd672c143 100644 --- a/addons/web/static/src/js/search.js +++ b/addons/web/static/src/js/search.js @@ -330,6 +330,12 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea }); } + // Launch a search on clicking the oe_searchview_search button + this.$element.on('click', 'button.oe_searchview_search', function (e) { + e.stopImmediatePropagation(); + self.do_search(); + }); + this.$element.on('keydown', '.oe_searchview_input, .oe_searchview_facet', function (e) { switch(e.which) { diff --git a/addons/web/static/src/xml/base.xml b/addons/web/static/src/xml/base.xml index ed63b5fbfbe..e4aa6797ba6 100644 --- a/addons/web/static/src/xml/base.xml +++ b/addons/web/static/src/xml/base.xml @@ -1220,6 +1220,8 @@
+