[IMP] enabling/disabling of switcher buttons on view switch
bzr revid: xmo@openerp.com-20110401090653-jr21w79p5e5pdfts
This commit is contained in:
parent
11bdbfef5c
commit
de1912d2a1
|
@ -396,7 +396,7 @@ body.openerp {
|
|||
}
|
||||
|
||||
/* View Manager */
|
||||
.openerp .views_switchers {
|
||||
.openerp .views-switchers {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,6 +55,12 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
|
|||
controller.start();
|
||||
this.views[view_type].controller = controller;
|
||||
}
|
||||
|
||||
this.$element
|
||||
.find('.views-switchers button').attr('disabled', true)
|
||||
.filter('[data-view-type!="' + view_type + '"]')
|
||||
.removeAttr('disabled');
|
||||
|
||||
for (var i in this.views) {
|
||||
if (this.views[i].controller) {
|
||||
this.views[i].controller.$element.toggle(i === view_type);
|
||||
|
@ -108,7 +114,7 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
|
|||
|
||||
this.setup_search_view(action);
|
||||
|
||||
this.$element.find('.views_switchers button').click(function() {
|
||||
this.$element.find('.views-switchers button').click(function() {
|
||||
self.on_mode_switch($(this).data('view-type'));
|
||||
});
|
||||
_.each(action.views, function(view) {
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
</t>
|
||||
<t t-name="ViewManager">
|
||||
<!-- TODO prefix id with the element_id of the controller t-attf-id="#{prefix}_localid" -->
|
||||
<div class="views_switchers">
|
||||
<div class="views-switchers">
|
||||
<t t-foreach="views" t-as="view">
|
||||
<button type="button" t-att-data-view-type="view[1]">
|
||||
<t t-esc="view[1]"/>
|
||||
|
|
Loading…
Reference in New Issue