Revision 2d587c41
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Layout/ActionBar/Action.pm | ||
---|---|---|
4 | 4 |
use parent qw(Rose::Object); |
5 | 5 |
|
6 | 6 |
use SL::Presenter; |
7 |
require SL::Layout::ActionBar::Submit;
|
|
7 |
require SL::Layout::ActionBar::Submit; |
|
8 | 8 |
|
9 | 9 |
use Rose::Object::MakeMethods::Generic ( |
10 | 10 |
'scalar --get_set_init' => [ qw(id params text) ], |
... | ... | |
30 | 30 |
return SL::Layout::ActionBar::Submit->new(text => $text, params => \%params); |
31 | 31 |
} |
32 | 32 |
|
33 |
sub callable { 0 } |
|
34 |
|
|
33 | 35 |
# shortcut for presenter |
34 | 36 |
|
35 | 37 |
sub p { |
SL/Layout/ActionBar/ComboBox.pm | ||
---|---|---|
4 | 4 |
use parent qw(SL::Layout::ActionBar::Action); |
5 | 5 |
|
6 | 6 |
use JSON; |
7 |
use List::MoreUtils qw(none); |
|
7 | 8 |
|
8 | 9 |
use Rose::Object::MakeMethods::Generic ( |
9 | 10 |
'scalar --get_set_init' => [ qw(actions) ], |
... | ... | |
21 | 22 |
sub render { |
22 | 23 |
my ($first, @rest) = @{ $_[0]->actions }; |
23 | 24 |
|
25 |
return if none { $_->callable } @{ $_[0]->actions }; |
|
24 | 26 |
return $first->render if !@rest; |
25 | 27 |
|
26 | 28 |
$_[0]->p->html_tag('div', |
SL/Layout/ActionBar/Link.pm | ||
---|---|---|
20 | 20 |
); |
21 | 21 |
} |
22 | 22 |
|
23 |
sub callable { 1 } |
|
24 |
|
|
23 | 25 |
1; |
SL/Layout/ActionBar/Submit.pm | ||
---|---|---|
10 | 10 |
); |
11 | 11 |
} |
12 | 12 |
|
13 |
sub callable { |
|
14 |
my ($self) = @_; |
|
15 |
return $self->params->{submit} || $self->params->{call} || $self->params->{link}; |
|
16 |
} |
|
17 |
|
|
13 | 18 |
1; |
Auch abrufbar als: Unified diff
ActionBar: leere ComboBoxen gar nicht anzeigen