X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/ff424b75f8f66c796eae294d0239f0440741e578..7cd6d451d97d1f1e7f3c0f9db2de03735dc8c8f0:/SL/Layout/ActionBar/ComboBox.pm diff --git a/SL/Layout/ActionBar/ComboBox.pm b/SL/Layout/ActionBar/ComboBox.pm index 9a545392f..0ff0bc10d 100644 --- a/SL/Layout/ActionBar/ComboBox.pm +++ b/SL/Layout/ActionBar/ComboBox.pm @@ -4,6 +4,7 @@ use strict; use parent qw(SL::Layout::ActionBar::Action); use JSON; +use List::MoreUtils qw(none); use Rose::Object::MakeMethods::Generic ( 'scalar --get_set_init' => [ qw(actions) ], @@ -20,6 +21,10 @@ sub from_params { sub render { my ($first, @rest) = @{ $_[0]->actions }; + + return if none { $_->callable } @{ $_[0]->actions }; + return $first->render if !@rest; + $_[0]->p->html_tag('div', $_[0]->p->html_tag('div', $first->render . $_[0]->p->html_tag('span'), class => 'layout-actionbar-combobox-head') . $_[0]->p->html_tag('div', join('', map { $_->render } @rest), class => 'layout-actionbar-combobox-list'),