[IMP] Css improvements for sidebar.

bzr revid: nicolas.vanhoren@openerp.com-20110412111456-zms7v8qapa2f1r50
This commit is contained in:
niv-openerp
2011-04-12 13:14:56 +02:00
parent b659e93b45
commit e4636f1e7e
4 changed files with 56 additions and 18 deletions
+28
View File
@@ -559,6 +559,10 @@ body.openerp {
}
.openerp .sidebar-main-div {
height:100%;
}
.openerp .sidebar-sub-div {
padding:0;
margin:0;
width:180px;
@@ -570,6 +574,14 @@ body.openerp {
font-size: 0.9em;
}
.openerp .closed-sidebar .sidebar-sub-div {
width:22px;
}
.openerp .closed-sidebar .sidebar-displaying-div {
display:none;
}
.openerp .sidebar-main-div a {
color: #555;
text-decoration: none;
@@ -609,3 +621,19 @@ body.openerp {
padding: 3px 3px 3px 10px;
}
.openerp .toggle-sidebar {
border-color: #D2CFCF;
border-style: solid;
border-width: 1px;
display: block;
background: url(../img/toggle-a-bg.png);
width: 21px;
height: 21px;
position: absolute;
z-index: 10;
}
.openerp .open-sidebar .toggle-sidebar {
margin-left: 158px;
background-position: 21px 0;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

+5
View File
@@ -199,6 +199,11 @@ openerp.base.Sidebar = openerp.base.BaseWidget.extend({
refresh: function() {
this.$element.html(QWeb.render("ViewManager.sidebar.internal", _.extend({_:_}, this)));
var self = this;
this.$element.find(".toggle-sidebar").click(function(e) {
self.$element.toggleClass('open-sidebar closed-sidebar');
e.stopPropagation();
e.preventDefault();
});
this.$element.find("a").click(function(e) {
var $this = jQuery(this);
var i = $this.attr("data-i");
+23 -18
View File
@@ -525,28 +525,33 @@
<input t-att-id="element_id"/>
</t>
<t t-name="ViewManager.sidebar">
<div t-att-id="element_id" class="sidebar-main-div">
<div t-att-id="element_id" class="sidebar-main-div open-sidebar">
</div>
</t>
<t t-name="ViewManager.sidebar.internal">
<t t-if="sections.length &gt; 0 &amp;&amp; _.detect(sections, function(x) {return x.elements.length &gt; 0;}) != undefined">
<div t-att-id="element_id" class="sidebar-sub-div">
<t t-set="i" t-value="0"/>
<t t-foreach="sections" t-as="section">
<t t-if="section.elements.length &gt; 0">
<h2><t t-esc="section.label"/></h2>
<ul>
<t t-set="j" t-value="0"/>
<t t-foreach="section.elements" t-as="element">
<li><a t-att-data-i="i" t-att-data-j="j" href="#"><t t-esc="element.name"/></a></li>
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</t>
<t t-set="i" t-value="i+1"/>
</t>
</div>
<t t-set="the_condition" t-value="sections.length &gt; 0 &amp;&amp; _.detect(sections, function(x)
{return x.elements.length &gt; 0;}) != undefined"/>
<t t-if="the_condition">
<a class="toggle-sidebar"></a>
<div t-att-id="element_id" class="sidebar-sub-div">
<div class="sidebar-displaying-div">
<t t-set="i" t-value="0"/>
<t t-foreach="sections" t-as="section">
<t t-if="section.elements.length &gt; 0">
<h2><t t-esc="section.label"/></h2>
<ul>
<t t-set="j" t-value="0"/>
<t t-foreach="section.elements" t-as="element">
<li><a t-att-data-i="i" t-att-data-j="j" href="#"><t t-esc="element.name"/></a></li>
<t t-set="j" t-value="j+1"/>
</t>
</ul>
</t>
<t t-set="i" t-value="i+1"/>
</t>
</div>
</div>
</t>
</t>
<t t-name="DialogWarning">