[IMP] Sidebar cleanup
bzr revid: fme@openerp.com-20110524103417-f077y3syyo2cmria
This commit is contained in:
parent
3286ef93b8
commit
48f6008666
|
@ -315,21 +315,20 @@ openerp.base.Sidebar = openerp.base.BaseWidget.extend({
|
|||
this.$element.addClass('open-sidebar');
|
||||
this.$element.removeClass('closed-sidebar');
|
||||
}
|
||||
|
||||
|
||||
this.$element.html(QWeb.render("ViewManager.sidebar.internal",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.oe_sidebar_action_a").click(function(e) {
|
||||
var $this = jQuery(this);
|
||||
var i = $this.attr("data-i");
|
||||
var j = $this.attr("data-j");
|
||||
var action = self.sections[i].elements[j];
|
||||
var index = $this.attr("data-index").split('-');
|
||||
var action = self.sections[index[0]].elements[index[1]];
|
||||
action.flags = {
|
||||
new_window : true
|
||||
}
|
||||
|
|
|
@ -690,20 +690,15 @@
|
|||
<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="1-1"/> <!-- al do stupid things -->
|
||||
<t t-foreach="sections" t-as="section">
|
||||
<t t-if="section.elements.length > 0">
|
||||
<t t-foreach="sections" t-as="section" t-if="section.elements.length">
|
||||
<h2><t t-esc="section.label"/></h2>
|
||||
<ul>
|
||||
<t t-set="j" t-value="1-1"/>
|
||||
<t t-foreach="section.elements" t-as="element">
|
||||
<li><a class="oe_sidebar_action_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>
|
||||
<li t-foreach="section.elements" t-as="element">
|
||||
<a class="oe_sidebar_action_a" t-attf-data-index="#{section_index}-#{element_index}" href="#">
|
||||
<t t-esc="element.name"/>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</t>
|
||||
<t t-set="i" t-value="i+1"/>
|
||||
</t>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue