[IMP] web: Improve switch company bar layout

fp request: add 0.1rem padding-top and -bottom to the items of the multicompany dropdown menu
This commit is contained in:
Yannick Tivisse
2019-05-28 14:31:34 +00:00
parent ec670beb4b
commit ac6cbbaf5d
3 changed files with 10 additions and 13 deletions
@@ -80,7 +80,7 @@ var SwitchCompanyMenu = Widget.extend({
var hash = $.bbq.getState()
var allowed_company_ids = _.map(hash.cids.split(','), function(company_id) {return parseInt(company_id);});
var current_company_id = allowed_company_ids[0];
if ($(ev.currentTarget).find('.fa-square-o')) {
if ($(ev.currentTarget).find('.fa-square-o').length) {
allowed_company_ids.push(companyID);
} else {
allowed_company_ids.splice(allowed_company_ids.indexOf(companyID), 1);
@@ -8,15 +8,12 @@
background-color: white;
}
.toggle_company {
.o_py {
padding-top: 0.2rem !important;
padding-bottom: 0.2rem !important;
&:hover {
background-color: #e9ecef;
}
}
.log_into {
&:hover {
background-color: #e9ecef;
background-color: #e9ecef !important;
}
}
}
+4 -4
View File
@@ -1569,8 +1569,8 @@
<li class="bg-info">Tap on the list to change company</li>
</t>
<t t-foreach="widget.user_companies" t-as="company">
<span role="menuitem" href="#" class="dropdown-item d-flex align-items-center py-0 px-0" data-menu="company" t-att-data-company-id="company[0]">
<div class="d-flex flex-grow-1 align-items-center py-0 log_into pl-3" t-att-style="company[0] === widget.current_company ? 'background-color: lightgrey;' : ''">
<div role="menuitem" href="#" class="dropdown-item d-flex py-0 px-0" data-menu="company" t-att-data-company-id="company[0]">
<div class="d-flex flex-grow-1 align-items-center py-0 log_into pl-3 o_py" t-att-style="company[0] === widget.current_company ? 'background-color: lightgrey;' : ''">
<t t-if="widget.allowed_company_ids.includes(company[0].toString())">
<span class='mr-3 company_label'>
<t t-esc="company[1]"/>
@@ -1583,7 +1583,7 @@
</t>
</div>
<t t-if="widget.toggle_company">
<div class="ml-auto pl-3 pr-3 border border-top-0 border-right-0 border-bottom-0 toggle_company">
<div class="ml-auto pl-3 pr-3 border border-top-0 border-right-0 border-bottom-0 toggle_company o_py">
<span style="height: 2rem;">
<t t-if="widget.allowed_company_ids.includes(company[0].toString())">
<i class="fa fa-fw fa-check-square pt-2"></i>
@@ -1594,7 +1594,7 @@
</span>
</div>
</t>
</span>
</div>
</t>
</div>
</li>