[FIX] web: list view: fixed button behavior
authorThibault Delavallée <tde@openerp.com>
Wed, 23 Apr 2014 09:41:24 +0000 (11:41 +0200)
committerThibault Delavallée <tde@openerp.com>
Wed, 23 Apr 2014 09:41:24 +0000 (11:41 +0200)
- icon-like behavior is the default behavior
- text-based buttons (using btn_txt class) are used whenever no icon is given to the
button in a list view.
This way the previous behavior is always the default behavior, and the css modifications are
done only for the text-based buttons, avoiding side-effects.

bzr revid: tde@openerp.com-20140423094124-8zq3yysy616aowu2

addons/web/static/src/css/base.css
addons/web/static/src/css/base.sass
addons/web/static/src/xml/base.xml

index 9dd8e55..503d6f8 100644 (file)
   padding: 3px 6px;
   white-space: pre-line;
 }
-.openerp .oe_list_content > tbody > tr > td > button.btn_img, .openerp .oe_list_content > tbody > tr > th > button.btn_img {
+.openerp .oe_list_content > tbody > tr > td > button, .openerp .oe_list_content > tbody > tr > th > button {
   border: none;
   background: transparent;
   padding: 0;
-  -moz-box-shadow: none;
-  -webkit-box-shadow: none;
-  box-shadow: none;
+}
+.openerp .oe_list_content > tbody > tr > td > button.btn_txt, .openerp .oe_list_content > tbody > tr > th > button.btn_txt {
+  border: 1px solid rgba(0, 0, 0, 0.4);
+  background: #e3e3e3;
+  padding: 3px 12px;
 }
 .openerp .oe_list_content > tbody > tr > td.oe_list_checkbox:first-child, .openerp .oe_list_content > tbody > tr th.oe_list_checkbox:first-child {
   width: 17px;
index ebffed2..8ebb2d8 100644 (file)
@@ -2248,11 +2248,14 @@ $sheet-padding: 16px
                     padding: 3px 6px
                     white-space: pre-line
                 > td, > th
-                    > button.btn_img
+                    > button
                         border: none
                         background: transparent
                         padding: 0
-                        @include box-shadow(none)
+                    > button.btn_txt
+                        border: 1px solid rgba(0,0,0,0.4)
+                        background: #e3e3e3
+                        padding: 3px 12px
                 > td.oe_list_checkbox:first-child, th.oe_list_checkbox:first-child
                     width: 17px
                     &:after
index a08de0b..85f3d3c 100644 (file)
 </t>
 <button t-name="ListView.row.text_button" type="button"
         t-att-title="widget.string" t-att-disabled="disabled || undefined"
-        t-att-class="disabled ? 'oe_list_button_disabled btn' : 'btn'">
-    <t t-esc="widget.string"/>
-</button>
+        t-att-class="disabled ? 'oe_list_button_disabled btn_txt oe_link' : 'btn_txt oe_link'"
+        ><t t-esc="widget.string"/></button>
 <button t-name="ListView.row.button" type="button"
         t-att-title="widget.string" t-att-disabled="disabled || undefined"
-        t-att-class="disabled ? 'oe_list_button_disabled btn_img' : 'btn_img'"
+        t-att-class="disabled ? 'oe_list_button_disabled' : ''"
         ><img t-attf-src="#{prefix}/web/static/src/img/icons/#{widget.icon}.png"
         t-att-alt="widget.string"/></button>
 <t t-extend="ListView.row">