Manche Comboboxes wie z.B. »Workflow« oder »mehr« haben auf dem obersten
Button keine Action konfiguriert (weder »submit« noch »call«). Um die
Benutzer nicht zu sehr zu verwirren, werden diese nun nicht mehr als
deaktiviert dargestellt. Bei einem Klick auf den Button-Teil der
Combobox wird dann das Menü aufgeklappt, genau so, als hätte man auf den
Pfeil-Teil geklickt.
$bar->add_actions('separator');
$bar->add_actions('combobox');
$bar->add_actions('separator');
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('more'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('more') ]);
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $::form->{id} * 1, 'id', 'glid' ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $::form->{id} * 1, 'id', 'glid' ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
$bar->add_actions('separator');
$bar->add_actions('combobox');
$bar->add_actions('separator');
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('Workflow'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('Workflow') ]);
$bar->actions->[-1]->add_actions([ t8('Use As New'),
submit => [ '#form', { action_use_as_new => 1 } ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
$bar->actions->[-1]->add_actions([ t8('Use As New'),
submit => [ '#form', { action_use_as_new => 1 } ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
]);
$bar->add_actions('combobox');
]);
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('Export'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('Export') ]);
$bar->actions->[-1]->add_actions([ ($form->{id} ? t8('Print') : t8('Preview')),
submit => [ '#form', { action_print => 1 } ],
checks => [ @req_trans_desc ],
$bar->actions->[-1]->add_actions([ ($form->{id} ? t8('Print') : t8('Preview')),
submit => [ '#form', { action_print => 1 } ],
checks => [ @req_trans_desc ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
]);
$bar->add_actions('combobox');
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
]);
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('more'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('more') ]);
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $form->{id} * 1, 'id' ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $form->{id} * 1, 'id' ],
disabled => !$form->{id} ? t8('This invoice has not been posted yet.') : undef,
$bar->add_actions('separator');
$bar->add_actions('combobox');
$bar->add_actions('separator');
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('Workflow'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('Workflow') ]);
$bar->actions->[-1]->add_actions([ t8('Sales Order'),
submit => [ '#form', { action_sales_order => 1 } ],
disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
$bar->actions->[-1]->add_actions([ t8('Sales Order'),
submit => [ '#form', { action_sales_order => 1 } ],
disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
]);
$bar->add_actions('combobox');
]);
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('Export'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('Export') ]);
$bar->actions->[-1]->add_actions([ t8('Print'),
submit => [ '#form', { action_print => 1 } ],
checks => [ @req_trans_desc ],
$bar->actions->[-1]->add_actions([ t8('Print'),
submit => [ '#form', { action_print => 1 } ],
checks => [ @req_trans_desc ],
checks => [ @req_trans_desc ],
]);
$bar->add_actions('combobox');
checks => [ @req_trans_desc ],
]);
$bar->add_actions('combobox');
- $bar->actions->[-1]->add_actions([ t8('more'),
- disabled => 1,
- ]);
+ $bar->actions->[-1]->add_actions([ t8('more') ]);
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $form->{id} * 1, 'id' ],
disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
$bar->actions->[-1]->add_actions([ t8('History'),
call => [ 'set_history_window', $form->{id} * 1, 'id' ],
disabled => !$form->{id} ? t8('This record has not been saved yet.') : undef,
};
k.ActionBarCombobox = function(e) {
};
k.ActionBarCombobox = function(e) {
- this.combobox = e;
- this.head = e.childNodes[0];
- this.toggle = this.head.childNodes[1];
- this.list = e.childNodes[0];
+ this.combobox = e;
+ this.head = e.childNodes[0];
+ this.topAction = this.head.childNodes[0];
+ this.toggle = this.head.childNodes[1];
+ this.list = e.childNodes[0];
this.init();
};
k.ActionBarCombobox.prototype = {
init: function() {
this.init();
};
k.ActionBarCombobox.prototype = {
init: function() {
- var obj = this;
- $(obj.toggle).on('click', function(event){
+ var obj = this;
+ var toggler = function(event){
$('div.' + CLASSES.combobox + '[id!=' + obj.combobox.id + ']').removeClass(CLASSES.active);
$(obj.combobox).toggleClass(CLASSES.active);
event.stopPropagation();
$('div.' + CLASSES.combobox + '[id!=' + obj.combobox.id + ']').removeClass(CLASSES.active);
$(obj.combobox).toggleClass(CLASSES.active);
event.stopPropagation();
+ };
+
+ $(obj.toggle).on('click', toggler);
+
+ var data = $(this.topAction).data('action') || {};
+ if (!data.call && !data.submit)
+ $(this.topAction).on('click', toggler);